mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-22 02:25:33 -04:00
A speaker that has dropped off the network fails on every command until somebody fixes it, so that is the one error in IPSpeaker that repeats forever rather than once. On a monitor deliberately marked unimportant it is noise, and it buries the failures worth acting on. Nothing about that is specific to speakers, so the policy goes in Logger as importanceLevel, with ErrorImportance and WarningImportance alongside the plain Error and Warning for callers to use. It takes the importance value itself rather than a monitor, so Logger needs to know nothing about monitors and callers that have some other notion of how much something matters can still use it. zmwatch.pl has been open coding the same idea as WARNING+$monitor->ImportanceNumber() in three places; it now calls WarningImportance instead, which is the same arithmetic and so leaves its levels exactly as they were, including the Not important case that lands in DEBUG1. That case is pinned by a test rather than quietly corrected: it is long standing behaviour and not this change's business. zmwatch no longer needs the logger object it was keeping for logPrint, so logInit() is called bare there as it is in every other script. Anything that is not a number counts as Normal, so a caller with no monitor to ask still reports in full: not knowing how much a monitor matters is no reason to hide its faults. IPSpeaker is then a one line change at the call site. Only the failure to reach the device is weighed; a refusal or unparseable content means the device answered and something is really wrong, which is worth an error however unimportant the monitor is, and does not repeat the same way. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JpiSWBmtQkR5bcgpHWY4ME