Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Unified Diff: logdog/client/cmd/logdog_butler/main.go

Issue 2976583002: [grpc/logging] Update to LoggerV2. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « grpc/logging/grpc_logger_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/cmd/logdog_butler/main.go
diff --git a/logdog/client/cmd/logdog_butler/main.go b/logdog/client/cmd/logdog_butler/main.go
index 3a53aeb5c3eb9de00e0ffcc0b1918756624c4aff..fb7bea2d9d898083bebd4a446a89cd567d6f1302 100644
--- a/logdog/client/cmd/logdog_butler/main.go
+++ b/logdog/client/cmd/logdog_butler/main.go
@@ -267,7 +267,13 @@ func mainImpl(ctx context.Context, defaultAuthOpts auth.Options, argv []string)
// Install a global gRPC logger adapter. This routes gRPC log messages that
// are emitted through our logger. We only log gRPC prints if our logger is
// configured to log info-level or lower.
- grpcLogging.Install(log.Get(a.Context), log.IsLogging(a.Context, log.Info))
+ logger := log.Get(a.Context)
+ if log.IsLogging(a.Context, log.Info) {
+ grpcLogging.Install(logger, log.GetLevel(a.Context))
+ } else {
+ // If we're not logging at INFO-level, suppress all gRPC logging output.
+ grpcLogging.Install(logger, grpcLogging.Suppress)
+ }
if err := a.project.Validate(); err != nil {
log.WithError(err).Errorf(a, "Invalid project (-project).")
« no previous file with comments | « grpc/logging/grpc_logger_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698