mirror of https://bitbucket.org/ausocean/av.git
cmd/revid-cli: initialisation of logger actually usses what was given as revid-cli verbosity flag input
This commit is contained in:
parent
dfb282cd25
commit
c3743174da
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue