bootstrapper: remove debug flag

This commit is contained in:
Moritz Sanft 2024-06-03 15:37:59 +02:00
parent 67b6b4dc55
commit 7123f0fcad
No known key found for this signature in database
GPG Key ID: 335D28368B1DA615
2 changed files with 6 additions and 14 deletions

View File

@ -43,22 +43,14 @@ const (
)
func main() {
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(level, log.Handler())).WithGroup("gRPC"))
}
logger.ReplaceGRPCLogger(
slog.New(
logger.NewLevelHandler(logger.VerbosityFromInt(*verbosity), log.Handler()),
).WithGroup("gRPC"),
)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

View File

@ -10,7 +10,7 @@ RemainAfterExit=yes
Restart=on-failure
EnvironmentFile=/run/constellation.env
Environment=PATH=/run/state/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=/usr/bin/bootstrapper $CONSTELLATION_DEBUG_FLAGS
ExecStart=/usr/bin/bootstrapper
[Install]
WantedBy=multi-user.target