Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
emrearslan committed Dec 26, 2022
1 parent ca24fe8 commit 635256a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions overlogger_example_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package over

import (
"errors"
"github.com/rs/zerolog"
"os"
)
Expand Down Expand Up @@ -101,7 +102,7 @@ func ExampleOverlog_Error() {
MDC().Set("x-correlation-id", "1234")
AddGlobalFields("x-correlation-id")

Log().Error("hello world")
Log().Error(errors.New("hello world"))

// Output: {"level":"error","x-correlation-id":"1234","message":"hello world"}
}
Expand All @@ -111,7 +112,7 @@ func ExampleOverlog_Errorf() {
MDC().Set("x-correlation-id", "1234")
AddGlobalFields("x-correlation-id")

Log().Errorf("hello %s", "world")
Log().Errorf("hello %s", errors.New("world"))

// Output: {"level":"error","x-correlation-id":"1234","message":"hello world"}
}
Expand Down Expand Up @@ -154,4 +155,4 @@ func ExampleOverlog_Printf() {
Log().Printf("hello %s", "world")

// Output: {"level":"debug","x-correlation-id":"1234","message":"hello world"}
}
}

0 comments on commit 635256a

Please sign in to comment.