Skip to content

Commit

Permalink
fix log name caller
Browse files Browse the repository at this point in the history
  • Loading branch information
kooksee committed Jul 18, 2024
1 parent a69048a commit 40ddf5b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions log/impl.log.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ func (l *loggerImpl) WithName(name string) Logger {

log := l.copy()
if log.fields == nil {
log.fields = Map{ModuleName: stack.Caller(1).Pkg}
} else {
log.fields[ModuleName] = stack.Caller(1).Pkg
log.fields = make(Map, 1)
}
log.fields[ModuleName] = stack.Caller(2).Pkg

if log.name == "" {
log.name = name
Expand Down

0 comments on commit 40ddf5b

Please sign in to comment.