Tidied logging statements

This commit is contained in:
Fred Boniface 2024-04-14 21:20:17 +01:00
parent c8709d67db
commit 86da330b91
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ func CheckCorpus(cfg *helpers.Configuration) {
log.Debug("CORPUS Data", zap.Duration("Data Age", dataAge), zap.Duration("Max Age", 14*24*time.Hour))
if dataAge >= fortnight {
log.Info("CORPUS Data is more than two weeks old")
log.Info("CORPUS update required")
err := RunCorpusUpdate(cfg)
if err != nil {
log.Warn("CORPUS Update did not run")
@ -33,6 +33,6 @@ func CheckCorpus(cfg *helpers.Configuration) {
log.Info("CORPUS data has been updated")
}
} else {
log.Info("CORPUS Data is less than two weeks old, not updating")
log.Info("CORPUS Data not stale, skipping updating")
}
}

View File

@ -27,6 +27,7 @@ func InitLogger() {
}
config := zap.NewDevelopmentConfig()
config.DisableStacktrace = true
config.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
config.Level = zap.NewAtomicLevelAt(level)
post, err = config.Build(zap.AddCallerSkip(1))