-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Currently, it is necessary to figure out how each log method will be called in order to specify a count of stack frames to Caller.
Lines 82 to 84 in 5739c26
| // Caller returns a Valuer that returns a file and line from a specified depth | |
| // in the callstack. Users will probably want to use DefaultCaller. | |
| func Caller(depth int) Valuer { |
This makes functions that wrap or forward to go-kit/log hard to use.
Suggestion: have a Helper method like in testing, which tells Caller to skip that function from the count.
This would be relatively expensive – a stack walk, lock and map lookup each time the helper is entered, and more map lookups when actually logging – but much more pleasant to use.
Metadata
Metadata
Assignees
Labels
No labels