NTP out of sync prompt fix if logger is disabled (#340)

* Add check to see if logger is enabled

* don't need an explicit true check here

* removed line
This commit is contained in:
Andrew
2019-08-21 09:22:14 +10:00
committed by Adrian Gallagher
parent 21172bf63f
commit b3e8be2c75

View File

@@ -223,7 +223,7 @@ func ActivateNTP() {
configNTPNegativeTime := (*bot.config.NTPClient.AllowedNegativeDifference - (*bot.config.NTPClient.AllowedNegativeDifference * 2))
if NTPcurrentTimeDifference > configNTPTime || NTPcurrentTimeDifference < configNTPNegativeTime {
log.Warnf("Time out of sync (NTP): %v | (time.Now()): %v | (Difference): %v | (Allowed): +%v / %v", NTPTime, currentTime, NTPcurrentTimeDifference, configNTPTime, configNTPNegativeTime)
if bot.config.NTPClient.Level == 0 {
if *bot.config.Logging.Enabled && bot.config.NTPClient.Level == 0 {
disable, errNTP := bot.config.DisableNTPCheck(os.Stdin)
if errNTP != nil {
log.Errorf("failed to disable ntp time check reason: %v", errNTP)