diff --git a/loop.go b/loop.go index 5894995..f30c329 100644 --- a/loop.go +++ b/loop.go @@ -113,7 +113,7 @@ func printStatus(batteryCharge int, limit int, isChargingEnabled bool, isPlugged isChargingEnabled == lastIsChargingEnabled && isPluggedIn == lastIsPluggedIn && maintainedChargingInProgress == lastMaintainedChargingInProgress && // All values are the same as last time - time.Now().Sub(lastTriedPrintTime) < time.Second*30 && // And it's been less than 30 seconds since last tried print + time.Since(lastTriedPrintTime) < time.Second*30 && // And it's been less than 30 seconds since last tried print !logrus.IsLevelEnabled(logrus.TraceLevel) { // Trace level is not enabled. If trace level is enabled, we want to print the status every time. // So we don't want to print the status every time. return