From 67b6b4dc556a85a68695f9ca6b55f58dd0952319 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:09:29 +0200 Subject: [PATCH] bootstrapper: disable gRPC logging --- bootstrapper/cmd/bootstrapper/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bootstrapper/cmd/bootstrapper/main.go b/bootstrapper/cmd/bootstrapper/main.go index fd7080c74..72ac52704 100644 --- a/bootstrapper/cmd/bootstrapper/main.go +++ b/bootstrapper/cmd/bootstrapper/main.go @@ -43,15 +43,21 @@ const ( ) func main() { - gRPCDebug := flag.Bool("debug", false, "Enable gRPC debug logging") + debug := flag.Bool("debug", false, "Enable debug logging") + gRPCDebug := flag.Bool("grpc-debug", false, "Enable gRPC debug logging") verbosity := flag.Int("v", 0, logger.CmdLineVerbosityDescription) flag.Parse() log := logger.NewJSONLogger(logger.VerbosityFromInt(*verbosity)).WithGroup("bootstrapper") + level := slog.LevelWarn + if *debug { + level = slog.LevelDebug + } + if *gRPCDebug { logger.ReplaceGRPCLogger(log.WithGroup("gRPC")) } else { - logger.ReplaceGRPCLogger(slog.New(logger.NewLevelHandler(slog.LevelWarn, log.Handler())).WithGroup("gRPC")) + logger.ReplaceGRPCLogger(slog.New(logger.NewLevelHandler(level, log.Handler())).WithGroup("gRPC")) } ctx, cancel := context.WithCancel(context.Background())