Skip to content

Improves "Logging improvements"

Viktor Grigorev requested to merge 115-tune-logger into master

Description

In the debug mode DLE sends log lines without any context info. Sometimes it's hard to realize where does it come from. This MR changes logger behaviour only in debug mode.

Related issue

#115

Examples

Example log line:

2021/06/29 08:40:29 tools.go:122: [DEBUG]  Virtualization system:  docker
2021/06/29 08:40:29 tools.go:132: [DEBUG]  [{bind /home/ubuntu/.dblab/server.yml /home/dblab/configs/config.yml false  0xc000333180 <nil> <nil>} {bind /var/run/docker.sock /var/run/docker.sock false  0xc0003331a0 <nil> <nil>} {bind /var/lib/dblab/dblab_pool/dump /var/lib/dblab/dblab_pool/dump false  0xc0003331c0 <nil> <nil>} {bind /var/lib/dblab/dblab_pool/clones/clone_pre_20210629084026/data /var/lib/dblab/dblab_pool/clones/clone_pre_20210629084026/data false  0xc0003331e0 <nil> <nil>}]
2021/06/29 08:40:29 tools.go:309: [INFO]   Docker image "postgresai/extended-postgres:13" already exists locally
2021/06/29 08:40:29 physical.go:553: [INFO]   Running container: dblab_promote_c3ddoucmtb0oldobcjpg. ID: 00542000ac4301a6bece1e3b7f0fc12558d55da8b159f054cc7023ac9d2f96e1

2021/06/29 08:40:40 tools.go:180: [INFO]   Stopping PostgreSQL instance [/usr/lib/postgresql/13/bin/pg_ctl -D /var/lib/dblab/dblab_pool/clones/clone_pre_20210629084026/data -w --timeout 600 stop]
2021/06/29 08:40:40 tools.go:279: [INFO]   Removing container ID: 00542000ac4301a6bece1e3b7f0fc12558d55da8b159f054cc7023ac9d2f96e1
2021/06/29 08:40:46 tools.go:285: [INFO]   Container "00542000ac4301a6bece1e3b7f0fc12558d55da8b159f054cc7023ac9d2f96e1" has been stopped
2021/06/29 08:40:46 tools.go:296: [INFO]   Container "00542000ac4301a6bece1e3b7f0fc12558d55da8b159f054cc7023ac9d2f96e1" has been removed
2021/06/29 08:40:46 runners.go:104: [DEBUG]  Run(Local): "zfs snapshot -r dblab_pool/clone_pre_20210629084026@snapshot_20210629084033"
2021/06/29 08:40:47 runners.go:147: [DEBUG]  Run(Local): output ""
2021/06/29 08:40:47 runners.go:104: [DEBUG]  Run(Local): "zfs set dblab:datastateat="20210629084033" dblab_pool/clone_pre_20210629084026@snapshot_20210629084033"

Checklist

  • the MR description has been reviewed
  • this MR contains text changes and they have been reviewed OR there are no texts changes
  • this MR contains GUI/CLI changes and they have been reviewed OR there are no GUI/CLI changes
  • this MR contains API changes, specifications reflect those changes and they have been reviewed OR there are no API changes
Edited by Artyom Kartasov

Merge request reports