Browse Source

set golang version

pull/17/head
andrey 7 months ago
parent
commit
4baf4b36e7
  1. 2
      .drone.yml
  2. 12
      logger_example_test.go

2
.drone.yml

@ -5,7 +5,7 @@ name: logger
steps: steps:
- name: test - name: test
image: golang:1.22 image: golang:1.22.2
volumes: volumes:
- name: deps - name: deps
path: /go/src/mod path: /go/src/mod

12
logger_example_test.go

@ -213,8 +213,8 @@ func ExampleNew_jsonFormat() {
logger.Err(ctx, "same error message") logger.Err(ctx, "same error message")
logger.WarnKVs(ctx, "same warn message", "obj", Obj{Name: "obj name"}) logger.WarnKVs(ctx, "same warn message", "obj", Obj{Name: "obj name"})
// Output: // Output:
// {"msg":"same error message","level":"error","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.21.5"} // {"msg":"same warn message","obj":{"Name":"obj name","IsEnable":false},"level":"warning","go-version":"go1.22.2"}
} }
func ExampleNew_textEncoding() { 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}) logger.InfoKVs(ctx, "same info message", "api-version", 0.1, "obj", Obj{Name: "text value", IsEnable: true})
// Output: // Output:
// msg="same error message" level=error 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.21.5 // msg="same info message" api-version=0.1 obj={Name:text value IsEnable:true} level=info go-version=go1.22.2
} }
type ctxKey string type ctxKey string
@ -252,7 +252,7 @@ func ExampleWith() {
log.GoVersion("go"), log.GoVersion("go"),
) )
logger.Info(vctx, "same message") 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() { func ExampleLogger_Print() {
@ -263,7 +263,7 @@ func ExampleLogger_Print() {
log.GoVersion("go"), log.GoVersion("go"),
) )
logger.Print("same message") 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() { func ExamplePrint() {

Loading…
Cancel
Save