Just a suggestion. Would it be better to replace example code here as the one below so that the callers matches in json and flat line logs? e.g. some/path/to/file.go:123 (no forward slash at the beginning which matches json version)
Thanks
From
zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
short := file
for i := len(file) - 1; i > 0; i-- {
if file[i] == '/' {
short = file[i+1:]
break
}
}
file = short
return file + ":" + strconv.Itoa(line)
}
Hi,
Just a suggestion. Would it be better to replace example code here as the one below so that the callers matches in json and flat line logs? e.g.
some/path/to/file.go:123
(no forward slash at the beginning which matches json version)Thanks
From
To