From ba7db545fec81ac335a42d5b3b7201d52a9875d2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 1 Sep 2019 17:56:22 +0200 Subject: [PATCH] Added extra depth to logging to correctly show the functions calling the logger in logs --- pkg/log/logging.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/log/logging.go b/pkg/log/logging.go index 70e8c9e5..73c1282a 100644 --- a/pkg/log/logging.go +++ b/pkg/log/logging.go @@ -50,6 +50,9 @@ func InitLogger() { return } + // This show correct caller functions + logInstance.ExtraCalldepth = 1 + if config.LogErrors.GetString() == "file" || config.LogStandard.GetString() == "file" { err := os.Mkdir(config.LogPath.GetString(), 0744) if err != nil && !os.IsExist(err) {