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 authored and kevwan committed Jan 31, 2025
1 parent b3d05e7 commit bbe5d8d
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 @@ -207,6 +207,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 @@ -234,7 +235,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 bbe5d8d

Please sign in to comment.