Skip to content

Commit

Permalink
Merge pull request #46 from dl1998/fix-skipcaller-level
Browse files Browse the repository at this point in the history
Fix skipCaller number for loggers
  • Loading branch information
dl1998 authored Apr 21, 2024
2 parents 1486797 + 184870b commit 3b93213
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/logger/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/structuredlogger/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3b93213

Please sign in to comment.