Skip to content
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

grpc_zap: fix caller annotation #431

Merged

Conversation

jkawamoto
Copy link
Contributor

@jkawamoto jkawamoto commented Jul 1, 2021

Since zapGrpcLoggerV2 wraps a zap's logger, caller annotations always point grpclogger.go instead of the expected file. This commit adds caller skip so that each log message has the correct annotation.

This commit also upgrades zap's version to v1.18.1 to use zap.OnFatal in tests. That function is necessary to catch fatal-level log messages.

Since `zapGrpcLoggerV2` wraps a zap's logger, caller annotations always
point `grpclogger.go` instead of the expected file. This commit adds
caller skip so that each log message has the correct annotation.

This commit also upgrades zap's version to v1.18.1 to use `zap.OnFatal`
in tests. That function is necessary to catch fatal level log messages.
@jkawamoto jkawamoto force-pushed the zap_caller_annotation branch from a51d7c9 to 8f77c1f Compare July 1, 2021 04:04
@johanbrandhorst johanbrandhorst merged commit 93b7816 into grpc-ecosystem:master Jul 2, 2021
@johanbrandhorst
Copy link
Collaborator

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants