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

Helper for logging GetServiceInfo #1

Open
jwreagor opened this issue Apr 25, 2018 · 0 comments
Open

Helper for logging GetServiceInfo #1

jwreagor opened this issue Apr 25, 2018 · 0 comments

Comments

@jwreagor
Copy link
Owner

This isn't zerolog specific but it would probably be helpful to wrap this in a function that consumers can use to list the services gRPC has registered.

for k, v := range server.grpcServer.GetServiceInfo() {
	mountLog := server.logger.With().
		Str("service", k).
		Str("component", "server-grpc").
		Logger()
	for _, r := range v.Methods {
		mountLog.Info().Msgf("mounted endpoint for %s", r.Name)
	}
}
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

No branches or pull requests

1 participant