Parse the god damn fucking loglevel properly
This commit is contained in:
5
main.go
5
main.go
@@ -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)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user