You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently there's no way to change the function name printed in the output when FunctionKey is set. Instead of printing the full path like github.com/wakatime/wakatime-cli/cmd.RunE, I'd like to manipulate this output and replace by cmd.RunE.
I thought I could add a new option like func WithFunctionNameReplacer(fn func(function string) string) Option that would set this cutomized function in logger struct and may be called at check() where the function name is captured.
Thank you for submitting an issue on this. Before we discuss further, may I ask why this is useful? Seems like replacing the function name here is a strict degradation on finding the logging site, so I'm wondering in what use case doing this would be necessary.
@sywhang my idea here is to find a way to simplify the function name printed. Clearly it's not the best to have the full name as Go's runtime return because it considers the long full path.
Is your feature request related to a problem? Please describe.
Currently there's no way to change the function name printed in the output when
FunctionKey
is set. Instead of printing the full path likegithub.com/wakatime/wakatime-cli/cmd.RunE
, I'd like to manipulate this output and replace bycmd.RunE
.Describe the solution you'd like
I thought I could add a new option like
func WithFunctionNameReplacer(fn func(function string) string) Option
that would set this cutomized function in logger struct and may be called atcheck()
where the function name is captured.Then the result will be
Describe alternatives you've considered
Could not find any alternative.
Is this a breaking change?
No
Additional context
Does that make sense? If so, I'd be happy to make a PR.
The text was updated successfully, but these errors were encountered: