Make warning about subscription ending a debug

This commit is contained in:
Isaac Connor
2026-01-31 16:52:03 -05:00
parent 9d76e170b9
commit 07f307e155

View File

@@ -935,17 +935,14 @@ void ONVIF::log_subscription_timing(const char* context) {
context, SystemTimePointToString(subscription_termination_time).c_str(),
seconds_until_termination,
SystemTimePointToString(next_renewal_time).c_str(),
seconds_until_renewal);
// Warn if we're getting close to termination and renewal is enabled
// If renewal is disabled, this is expected behavior - just log at debug level
static_cast<intmax_t>(seconds_until_renewal));
// Log at debug level when we're getting close to termination
// This is informational - actual renewal failures are logged as Error/Warning in Renew()
// If renewal is enabled, we will renew or re-subscribe. If disabled, we will re-subscribe.
if (seconds_until_termination < ONVIF_RENEWAL_ADVANCE_SECONDS && seconds_until_termination > 0) {
if (renewal_enabled) {
Warning("ONVIF: Subscription terminating soon! Only %ld seconds remaining", seconds_until_termination);
} else {
Debug(1, "ONVIF: Subscription terminating in %ld seconds (renewal disabled, will re-subscribe)",
seconds_until_termination);
}
Debug(1, "ONVIF: Subscription terminating in %jd seconds%s",
static_cast<intmax_t>(seconds_until_termination),
renewal_enabled ? ", will renew" : " (renewal disabled, will re-subscribe)");
}
}