diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 6ca6ba68..a53d08a0 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -145,7 +145,24 @@ func handleFlags() revid.Config { flag.Parse() - log = logger.New(defaultLogVerbosity, &smartlogger.New(*logPathPtr).LogRoller) + switch *verbosityPtr { + case "Debug": + cfg.LogLevel = logger.Debug + case "Info": + cfg.LogLevel = logger.Info + case "Warning": + cfg.LogLevel = logger.Warning + case "Error": + cfg.LogLevel = logger.Error + case "Fatal": + cfg.LogLevel = logger.Fatal + case "": + cfg.LogLevel = defaultLogVerbosity + default: + log.Log(logger.Error, pkg+"bad verbosity argument") + } + + log = logger.New(cfg.LogLevel, &smartlogger.New(*logPathPtr).LogRoller) cfg.Logger = log @@ -225,17 +242,6 @@ func handleFlags() revid.Config { log.Log(logger.Error, pkg+"bad packetization argument") } - switch *verbosityPtr { - case "No": - cfg.LogLevel = logger.Fatal - case "Debug": - cfg.LogLevel = logger.Debug - //logger.SetLevel(logger.Debug) - case "": - default: - log.Log(logger.Error, pkg+"bad verbosity argument") - } - if *configFilePtr != "" { netsender.ConfigFile = *configFilePtr }