Skip to content

Commit

Permalink
fix(logging): fix callerSkipOffset change 1
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyTony committed Oct 9, 2023
1 parent a743d12 commit c31de2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func TestLogging_WithContext(t *testing.T) {
t.Logf("trace_id: %s", spanContext.TraceID().String())
t.Logf("span_id: %s", spanContext.SpanID().String())

logging.WithContext(ctx).Info("TestDefault_WithContext")
logging.WithContext(ctx).WithFields(map[string]any{
"11": 222,
}).Info("TestDefault_WithContext")
}

func TestLogging_WithFields(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
spanKey = "span_id"
traceKey = "trace_id"

callerSkipOffset = 2
callerSkipOffset = 1

fileMode = "file"
consoleMode = "console"
Expand Down

0 comments on commit c31de2d

Please sign in to comment.