Files
packages/logger/ctx_test.go
zhaoyupeng bb5dd2583d feat: 修改了 logger ctx 的 key
feat: logger trace-value 的格式
2025-07-18 09:52:30 +08:00

18 lines
384 B
Go

package logger
import (
"context"
"testing"
)
func TestCtxLog(t *testing.T) {
DebugCtx(nil, "hello %s", "world")
InfoCtx(nil, "hello %s", "world")
WarnCtx(context.Background(), "hello %s", "world")
ctx := context.Background()
ctx = context.WithValue(ctx, TraceId, "value")
SetLogLevel(LogLevelDebug)
DebugCtx(ctx, "hello %s", "world")
ErrorCtx(ctx, "hello %s", "world")
}