|
|
@ -213,8 +213,8 @@ func ExampleNew_jsonFormat() { |
|
|
|
logger.Err(ctx, "same error message") |
|
|
|
logger.WarnKVs(ctx, "same warn message", "obj", Obj{Name: "obj name"}) |
|
|
|
// Output:
|
|
|
|
// {"msg":"same error message","level":"error","go-version":"go1.21.5"}
|
|
|
|
// {"msg":"same warn message","obj":{"Name":"obj name","IsEnable":false},"level":"warning","go-version":"go1.21.5"}
|
|
|
|
// {"msg":"same error message","level":"error","go-version":"go1.22.2"}
|
|
|
|
// {"msg":"same warn message","obj":{"Name":"obj name","IsEnable":false},"level":"warning","go-version":"go1.22.2"}
|
|
|
|
} |
|
|
|
|
|
|
|
func ExampleNew_textEncoding() { |
|
|
@ -227,8 +227,8 @@ func ExampleNew_textEncoding() { |
|
|
|
logger.InfoKVs(ctx, "same info message", "api-version", 0.1, "obj", Obj{Name: "text value", IsEnable: true}) |
|
|
|
|
|
|
|
// Output:
|
|
|
|
// msg="same error message" level=error go-version=go1.21.5
|
|
|
|
// msg="same info message" api-version=0.1 obj={Name:text value IsEnable:true} level=info go-version=go1.21.5
|
|
|
|
// msg="same error message" level=error go-version=go1.22.2
|
|
|
|
// msg="same info message" api-version=0.1 obj={Name:text value IsEnable:true} level=info go-version=go1.22.2
|
|
|
|
} |
|
|
|
|
|
|
|
type ctxKey string |
|
|
@ -252,7 +252,7 @@ func ExampleWith() { |
|
|
|
log.GoVersion("go"), |
|
|
|
) |
|
|
|
logger.Info(vctx, "same message") |
|
|
|
// Output: msg="same message" level=info requestID=6a5fa048-7181-11ea-bc55-0242ac130003 api=0.1.0 go=go1.21.5
|
|
|
|
// Output: msg="same message" level=info requestID=6a5fa048-7181-11ea-bc55-0242ac130003 api=0.1.0 go=go1.22.2
|
|
|
|
} |
|
|
|
|
|
|
|
func ExampleLogger_Print() { |
|
|
@ -263,7 +263,7 @@ func ExampleLogger_Print() { |
|
|
|
log.GoVersion("go"), |
|
|
|
) |
|
|
|
logger.Print("same message") |
|
|
|
// Output: msg="same message" level=info client=http api=0.1.0 go=go1.21.5
|
|
|
|
// Output: msg="same message" level=info client=http api=0.1.0 go=go1.22.2
|
|
|
|
} |
|
|
|
|
|
|
|
func ExamplePrint() { |
|
|
|