feat: 修改了 logger ctx 的 key
feat: logger trace-value 的格式
This commit is contained in:
@ -2,7 +2,6 @@ package logger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gitea.loveuer.com/yizhisec/packages/opt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -11,7 +10,7 @@ func TestCtxLog(t *testing.T) {
|
||||
InfoCtx(nil, "hello %s", "world")
|
||||
WarnCtx(context.Background(), "hello %s", "world")
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, opt.TraceKey, "value")
|
||||
ctx = context.WithValue(ctx, TraceId, "value")
|
||||
SetLogLevel(LogLevelDebug)
|
||||
DebugCtx(ctx, "hello %s", "world")
|
||||
ErrorCtx(ctx, "hello %s", "world")
|
||||
|
Reference in New Issue
Block a user