Skip to content

Commit

Permalink
fix global field append in logc
Browse files Browse the repository at this point in the history
  • Loading branch information
JiChenSSG committed Sep 29, 2024
1 parent f90d964 commit 5d1e3b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/logx/richlogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func (l *richLogger) WithFields(fields ...LogField) Logger {
func (l *richLogger) buildFields(fields ...LogField) []LogField {
fields = append(l.fields, fields...)
fields = append(fields, Field(callerKey, getCaller(callerDepth+l.callerSkip)))
fields = combineGlobalFields(fields)

if l.ctx == nil {
return fields
Expand Down Expand Up @@ -210,7 +211,7 @@ func (l *richLogger) buildFields(fields ...LogField) []LogField {

func (l *richLogger) debug(v any, fields ...LogField) {
if shallLog(DebugLevel) {
getWriter().Debug(v, l.buildFields(fields...)...)
getWriter().Debug(v, (l.buildFields(fields...))...)
}
}

Expand Down

0 comments on commit 5d1e3b9

Please sign in to comment.