Caller adds the file:line of the caller with the zerolog.CallerFieldName key. The argument skip is the number of stack frames to ascend Skip If not passed, use the global variable CallerSkipFrameCount
(skip ...int)
| 856 | // The argument skip is the number of stack frames to ascend |
| 857 | // Skip If not passed, use the global variable CallerSkipFrameCount |
| 858 | func (e *Event) Caller(skip ...int) *Event { |
| 859 | sk := CallerSkipFrameCount |
| 860 | if len(skip) > 0 { |
| 861 | sk = skip[0] + CallerSkipFrameCount |
| 862 | } |
| 863 | return e.caller(sk) |
| 864 | } |
| 865 | |
| 866 | func (e *Event) caller(skip int) *Event { |
| 867 | if e == nil { |