Update example of usage CallerMarshalFunc (#475)
There was changes in https://github.com/rs/zerolog/pull/457 pass program counter to CallerMarshalFunc. Update example in README.md
This commit is contained in:
parent
c2b9d0e2de
commit
e218d18951
|
@ -411,7 +411,7 @@ log.Info().Msg("hello world")
|
||||||
Equivalent of `Lshortfile`:
|
Equivalent of `Lshortfile`:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
zerolog.CallerMarshalFunc = func(file string, line int) string {
|
zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
|
||||||
short := file
|
short := file
|
||||||
for i := len(file) - 1; i > 0; i-- {
|
for i := len(file) - 1; i > 0; i-- {
|
||||||
if file[i] == '/' {
|
if file[i] == '/' {
|
||||||
|
|
Loading…
Reference in New Issue