Skip to content

Commit c1dec22

Browse files
committed
fix: lower expected stream outage logging
1 parent 3efadd1 commit c1dec22

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

printguard/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _publish_stream_error(self, error_message: str) -> None:
154154
if self.snapshot.stream == StreamState.ON:
155155
LOGGER.warning("Stream error: %s", error_message)
156156
else:
157-
LOGGER.info("Stream unavailable: %s", error_message)
157+
LOGGER.debug("Stream unavailable: %s", error_message)
158158
self.classification_policy.reset()
159159
self.snapshot = ServiceSnapshot(
160160
status=ServiceStatus.OFFLINE,

tests/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ def test_publish_stream_error_logs_info_while_stream_is_already_offline(
9595
) -> None:
9696
service, _fake_mqtt = make_service(monkeypatch)
9797

98-
with caplog.at_level(logging.INFO, logger="printguard.runner"):
98+
with caplog.at_level(logging.DEBUG, logger="printguard.runner"):
9999
service._publish_stream_error("camera unavailable")
100100

101101
assert "Stream unavailable: camera unavailable" in caplog.text
102-
assert not any(record.levelno >= logging.WARNING for record in caplog.records)
102+
assert not any(record.levelno >= logging.INFO for record in caplog.records)
103103

104104

105105
def test_publish_stream_error_logs_warning_after_stream_was_online(

0 commit comments

Comments
 (0)