Add caller (file:line number) to non-tracing entries?
Offen
- Vorherrschende Sprache
- Go
- Sterne
- 1.4k
- Forks
- 110
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Any opinions on this? It's available from `runtime.Caller`. Following the current design, it could be enabled by having a function like `log.IncludeCaller(bool)` and then every entry would include a field `caller` with value `file:line number`). Could also implement this as the default log library handles flags, e.g. `log.SetFlags(log.LstdFlags | log.Lshortfile)`.
I'm happy to create a PR for this if you'd like.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.