Fix sub-logger by context example (#106)
Not quite sure but looks like the example is using the wrong API.
This commit is contained in:
parent
785a567b10
commit
624b3116d8
|
@ -364,7 +364,7 @@ hooked.Warn().Msg("")
|
||||||
### Pass a sub-logger by context
|
### Pass a sub-logger by context
|
||||||
|
|
||||||
```go
|
```go
|
||||||
ctx := log.With("component", "module").Logger().WithContext(ctx)
|
ctx := log.With().Str("component", "module").Logger().WithContext(ctx)
|
||||||
|
|
||||||
log.Ctx(ctx).Info().Msg("hello world")
|
log.Ctx(ctx).Info().Msg("hello world")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue