-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get function name in log output ? #925
Comments
You need to set the config := zap.NewDevelopmentConfig()
config.EncoderConfig.FunctionKey = "func" That should include a field called "func" which will contain the caller's function name. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to get function name printed in logs ? I see this PR request has added this functionality. I am unable to get it working though
This is my code:
This is the output I get with/without the addition of AddCaller() option
I am expecting something like
The text was updated successfully, but these errors were encountered: