feat: logctx add default uuid

This commit is contained in:
zhaoyupeng
2025-06-12 18:05:05 +08:00
parent 4eb256bc78
commit 7509b6c8c6
2 changed files with 29 additions and 33 deletions

View File

@ -11,5 +11,8 @@ func TestCtxLog(t *testing.T) {
InfoCtx(nil, "hello %s", "world")
WarnCtx(context.Background(), "hello %s", "world")
ctx := context.Background()
context.WithValue(ctx, opt.TraceKey, "value")
ctx = context.WithValue(ctx, opt.TraceKey, "value")
SetLogLevel(LogLevelDebug)
DebugCtx(ctx, "hello %s", "world")
ErrorCtx(ctx, "hello %s", "world")
}