Added --log-level option (#531)

This commit is contained in:
Geoff Bourne
2026-03-17 08:06:07 -05:00
committed by GitHub
parent 5c7f5d7b36
commit b6e6114c56
2 changed files with 9 additions and 3 deletions
+6 -3
View File
@@ -24,9 +24,10 @@ func showVersion() {
}
type CliConfig struct {
Version bool `usage:"Output version and exit"`
Debug bool `usage:"Enable debug logs"`
Trace bool `usage:"Enable trace logs"`
Version bool `usage:"Output version and exit"`
Debug bool `usage:"Enable debug logs"`
Trace bool `usage:"Enable trace logs"`
LogLevel logrus.Level `usage:"Set a specific log filtering level, such as debug, info, warn, error\nIgnored when --debug or --trace is used" default:"info"`
ServerConfig server.Config `flatten:"true"`
}
@@ -49,6 +50,8 @@ func main() {
} else if cliConfig.Debug {
logrus.SetLevel(logrus.DebugLevel)
logrus.Debug("Debug logs enabled")
} else {
logrus.SetLevel(cliConfig.LogLevel)
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)