mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-09 13:58:11 +00:00
fix: improve logging in routines
This commit is contained in:
@@ -87,6 +87,10 @@ func (l *Logger) Init() {
|
||||
})
|
||||
}
|
||||
|
||||
if base.GetLevel() == zerolog.TraceLevel || base.GetLevel() == zerolog.DebugLevel {
|
||||
base = base.With().Caller().Logger()
|
||||
}
|
||||
|
||||
l.base = base
|
||||
l.audit = l.createLogger("audit", l.config.Streams.Audit)
|
||||
l.HTTP = l.createLogger("http", l.config.Streams.HTTP)
|
||||
@@ -113,9 +117,6 @@ func (l *Logger) createLogger(component string, cfg model.LogStreamConfig) zerol
|
||||
if cfg.Level != "" {
|
||||
sub = sub.Level(l.parseLogLevel(cfg.Level))
|
||||
}
|
||||
if sub.GetLevel() == zerolog.DebugLevel {
|
||||
sub = sub.With().Caller().Logger()
|
||||
}
|
||||
return sub
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user