cmd/revid-cli: send logs using smartlogger

This commit is contained in:
Saxon 2020-01-18 09:54:12 +10:30 committed by Scott
parent 82e2df5d88
commit 39d0fa12d0
1 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,10 @@ const (
var canProfile = true var canProfile = true
// The logger that will be used throughout. // The logger that will be used throughout.
var log *logger.Logger var (
smartLog *smartlogger.Smartlogger
log *logger.Logger
)
const ( const (
metaPreambleKey = "copyright" metaPreambleKey = "copyright"
@ -160,7 +163,8 @@ func handleFlags() config.Config {
cfg.LogLevel = defaultLogVerbosity cfg.LogLevel = defaultLogVerbosity
} }
log = logger.New(cfg.LogLevel, &smartlogger.New(*logPathPtr).LogRoller, true) smartLog = smartlogger.New(*logPathPtr)
log = logger.New(cfg.LogLevel, &smartLog.LogRoller, true)
cfg.Logger = log cfg.Logger = log
@ -351,6 +355,8 @@ func run(cfg config.Config) {
ns.SetMode(paused, &vs) ns.SetMode(paused, &vs)
} }
smartLog.SendLogs(ns)
sleep: sleep:
sleepTime, err := strconv.Atoi(ns.Param("mp")) sleepTime, err := strconv.Atoi(ns.Param("mp"))
if err != nil { if err != nil {