revid: fix logging control

Setting log level at end of Revid.setConfig. Revid variable Logging to logging.
This commit is contained in:
Saxon Nelson-Milton 2020-04-10 16:22:02 +01:00
parent cc467243ea
commit 2bfb4d6b95
1 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,6 @@ func New(c config.Config, ns *netsender.Sender) (*Revid, error) {
if err != nil {
return nil, fmt.Errorf("could not set config, failed with error: %w", err)
}
r.cfg.Logger.SetLevel(c.LogLevel)
go r.handleErrors()
return &r, nil
}
@ -247,6 +246,7 @@ func (r *Revid) setConfig(config config.Config) error {
}
r.cfg.Logger.Log(logger.Info, "config validated")
r.cfg = config
r.cfg.Logger.SetLevel(r.cfg.LogLevel)
return nil
}
@ -739,7 +739,7 @@ func (r *Revid) Update(vars map[string]string) error {
break
}
r.cfg.BurstPeriod = uint(v)
case "Logging":
case "logging":
switch value {
case "Debug":
r.cfg.LogLevel = logger.Debug