Parse the god damn fucking loglevel properly

This commit is contained in:
2025-12-19 16:14:11 +01:00
parent 98e05f4998
commit 12e0612b48

View File

@@ -55,7 +55,10 @@ Features:
- Parallel file processing - Parallel file processing
- Command filtering and organization`, - Command filtering and organization`,
PersistentPreRun: func(cmd *cobra.Command, args []string) { PersistentPreRun: func(cmd *cobra.Command, args []string) {
logger.InitFlag() logLevelStr, _ := cmd.Flags().GetString("loglevel")
logLevel := logger.ParseLevel(logLevelStr)
logger.SetLevel(logLevel)
mainLogger.SetLevel(logLevel)
mainLogger.Info("Initializing with log level: %s", logger.GetLevel().String()) mainLogger.Info("Initializing with log level: %s", logger.GetLevel().String())
mainLogger.Trace("Full argv: %v", os.Args) mainLogger.Trace("Full argv: %v", os.Args)
}, },