Closed codenoid closed 4 months ago
I would like to be assigned if owner want to implement this
I don't understand your question, can you please elaborate?
there is a built-in method in zerolog called .Caller(n)
with the functionality:
Caller adds the file:line of the caller with the zerolog.CallerFieldName key. The argument skip is the number of stack frames to ascend Skip If not passed, use the global variable CallerSkipFrameCount
where it add key caller
with a value of file:line
to the log
=========
my question is, why there is no built-in method called "CallerFunc()" (for example) where the functionality is to add caller function name to the log
You can add it by customizing CallerMarshalFunc
but my purpose was to add the caller func name to the new key instead of inside caller's default key, but maybe, this kind of change are too small for this large user's library, thanks
Hello, I'm trying to get function name where a logger is being called, currently my code is doing like this:
there is a built-in
.Caller()
method, why there is no built-in method to getting the function name? or maybe there is?thankyou