1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00

fix WithField error

This commit is contained in:
2022-05-11 17:24:44 +08:00
parent aac79b4997
commit ffaf129ddb
2 changed files with 8 additions and 3 deletions

View File

@ -27,11 +27,13 @@ func (l *logrusWrpper) SetLevel(level Level) {
}
func (l *logrusWrpper) WithField(key string, value any) Logger {
return l.WithFields(Fields{key: value})
return l.WithFields(Fields{key: value}).(*logrusWrpper)
}
func (l *logrusWrpper) WithFields(fields Fields) Logger {
return &logrusWrpper{
Entry: l.Logger.WithFields(logrus.Fields(fields)),
l = &logrusWrpper{
Entry: l.Entry.WithFields(logrus.Fields(fields)),
}
return l
}