WithCaller configures the Logger to include the filename and line number of the caller in log messages--if available.
(enabled bool)
| 46 | // WithCaller configures the Logger to include the filename and line number |
| 47 | // of the caller in log messages--if available. |
| 48 | func WithCaller(enabled bool) HandlerOption { |
| 49 | return handlerOptionFunc(func(handler *Handler) { |
| 50 | handler.addCaller = enabled |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | // WithCallerSkip increases the number of callers skipped by caller annotation |
| 55 | // (as enabled by the [WithCaller] option). |