From 184870b92efe0ca7ad4485fe1434ddeec7e2b0fe Mon Sep 17 00:00:00 2001 From: Dmytro Leshchenko Date: Sun, 21 Apr 2024 23:24:19 +0200 Subject: [PATCH] Fix skipCaller number for loggers --- pkg/logger/common.go | 2 +- pkg/structuredlogger/common.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/logger/common.go b/pkg/logger/common.go index 36be805..7a0e9f0 100644 --- a/pkg/logger/common.go +++ b/pkg/logger/common.go @@ -25,7 +25,7 @@ type baseLogger struct { // Log logs interpolated message with the provided level.Level. func (logger *baseLogger) Log(level level.Level, message string, parameters ...any) { - record := logrecord.New(logger.name, level, logger.timeFormat, message, parameters, 3) + record := logrecord.New(logger.name, level, logger.timeFormat, message, parameters, 4) for _, registeredHandler := range logger.handlers { registeredHandler.Write(record) } diff --git a/pkg/structuredlogger/common.go b/pkg/structuredlogger/common.go index dbc706e..dc1e757 100644 --- a/pkg/structuredlogger/common.go +++ b/pkg/structuredlogger/common.go @@ -46,7 +46,7 @@ func convertParametersToMap(parameters ...any) map[string]interface{} { func (logger *baseLogger) Log(logLevel level.Level, parameters ...any) { var parametersMap = convertParametersToMap(parameters...) - logRecord := logrecord.New(logger.name, logLevel, logger.timeFormat, parametersMap, 3) + logRecord := logrecord.New(logger.name, logLevel, logger.timeFormat, parametersMap, 4) for _, registeredHandler := range logger.handlers { registeredHandler.Write(logRecord)