Skip to content

Commit da3a363

Browse files
committed
Reduce log verbosity and remove auto-load message
Lowered several log statements from INFO to DEBUG in the OpenCV camera backend and camera config preview to reduce noisy logs during normal operation. Removed the deprecated auto-loaded myconfig.json statusBar message in the main window. Also clarified a closeEvent comment and updated a test comment to mark a flakiness note as addressed.
1 parent 36c033c commit da3a363

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

dlclivegui/cameras/backends/opencv_backend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def open(self) -> None:
168168
ns["device_pid"] = int(chosen.pid)
169169
if chosen.name:
170170
ns["device_name"] = chosen.name
171-
logger.info("Persisted OpenCV device_id=%s", chosen.stable_id)
171+
logger.debug("Persisted OpenCV device_id=%s", chosen.stable_id)
172172

173173
self._capture, spec = open_with_fallbacks(index, backend_flag)
174174

@@ -398,7 +398,7 @@ def _configure_capture(self) -> None:
398398
self._actual_fps = float(self._capture.get(cv2.CAP_PROP_FPS) or 0.0)
399399

400400
# For clarity in logs
401-
logger.info("Resolution requested=Auto, actual=%sx%s", self._actual_width, self._actual_height)
401+
logger.debug("Resolution requested=Auto, actual=%sx%s", self._actual_width, self._actual_height)
402402

403403
elif not self._fast_start:
404404
# Verified, robust path (tries candidates + verifies)
@@ -431,7 +431,7 @@ def _configure_capture(self) -> None:
431431
if (self._actual_width or 0) > 0 and (self._actual_height or 0) > 0:
432432
actual_res = (int(self._actual_width), int(self._actual_height))
433433

434-
logger.info(
434+
logger.debug(
435435
"Resolution requested=%s, actual=%s",
436436
f"{req_w}x{req_h}" if (req_w > 0 and req_h > 0) else "Auto",
437437
f"{actual_res[0]}x{actual_res[1]}" if actual_res else "unknown",

dlclivegui/gui/camera_config/camera_config_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ def _execute_pending_restart(self, *, reason: str) -> None:
13931393
if not cam:
13941394
return
13951395

1396-
LOGGER.info("[Preview] executing restart reason=%s", reason)
1396+
LOGGER.debug("[Preview] executing restart reason=%s", reason)
13971397
self._begin_preview_load(cam, reason="restart")
13981398

13991399
def _cancel_loading(self) -> None:

dlclivegui/gui/main_window.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ def __init__(self, config: ApplicationSettings | None = None):
194194
self._display_timer.timeout.connect(self._update_display_from_pending)
195195
self._display_timer.start()
196196

197-
# Show status message if myconfig.json was loaded
198-
# FIXME @C-Achard deprecated behavior, remove later
199-
if self._config_path and self._config_path.name == "myconfig.json":
200-
self.statusBar().showMessage(f"Auto-loaded configuration from {self._config_path}", 5000)
201-
202197
# Validate cameras from loaded config (deferred to allow window to show first)
203198
# NOTE IMPORTANT (tests/CI): This is scheduled via a QTimer and may fire during pytest-qt teardown.
204199
QTimer.singleShot(100, self._validate_configured_cameras)
@@ -208,7 +203,7 @@ def __init__(self, config: ApplicationSettings | None = None):
208203
# Mitigations for tests/CI:
209204
# - Disable this timer by monkeypatching _validate_configured_cameras in GUI tests
210205
# - OR monkeypatch/override _show_warning/_show_error to no-op in GUI tests (easiest)
211-
# - OR use a cancellable QTimer attribute and stop() it in closeEven
206+
# - OR use a cancellable QTimer attribute and stop() it in closeEvent
212207

213208
def resizeEvent(self, event):
214209
super().resizeEvent(event)

tests/services/test_dlc_processor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ def test_worker_processes_frames(qtbot, monkeypatch_dlclive, settings_model):
6363
proc.enqueue_frame(frame, timestamp=2.0 + i)
6464
qtbot.wait(5) # ms
6565

66-
# FIXME @C-Achard this still fails randomly
66+
# NOTE @C-Achard this still fails randomly
6767
# the timeout has to be surprisingly large here
6868
# not sure if it's qtbot or threading scheduling delays
69+
# Should be fixed now.
6970
qtbot.waitUntil(lambda: proc.get_stats().frames_processed >= 3, timeout=3000)
7071

7172
finally:

0 commit comments

Comments
 (0)