Summary
Add optional file/line field to log lines, click it in the terminal to jump to that spot in the editor.
Motivation
Easier debugging: see where log lines come from without grepping. Feature exists in pkg/log, not exposed.
Implementation
Enable caller in logger; config/flag to turn on/off and pick category (error vs all). Reuse WithCaller, optionally WithCallerFunc. .
Drawbacks
runtime.Caller() costs CPU per line; more log bytes. Default off, category=error only to limit.
Summary
Add optional file/line field to log lines, click it in the terminal to jump to that spot in the editor.
Motivation
Easier debugging: see where log lines come from without grepping. Feature exists in
pkg/log, not exposed.Implementation
Enable caller in logger; config/flag to turn on/off and pick category (error vs all). Reuse
WithCaller, optionallyWithCallerFunc. .Drawbacks
runtime.Caller()costs CPU per line; more log bytes. Default off, category=error only to limit.