Skip to content

feat: opt-in debug logging (plugin-side) - #29

Merged
HichTala merged 18 commits into
HichTala:masterfrom
leiteszeke:up/04-debug-mode
Oct 13, 2026
Merged

HichTala merged 18 commits into
HichTala:masterfrom
leiteszeke:up/04-debug-mode

Conversation

@leiteszeke

@leiteszeke leiteszeke commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #28 (crop/rotation), which stacks on #27 / #26. Review/merge in order.

Summary

Adds an opt-in "Enable debug logging" toggle (Draw 2 settings → Advanced features, off by default) that surfaces the diagnostics needed to troubleshoot detection — without editing any code. Plugin-side only.

Changes

  • src/DrawDock.{cpp,hpp} — in debug mode, log the exact backend launch to the dock's log panel (the resolved deck-list paths, channel, model, confidence and screen-time thresholds) and stop filtering the backend's stdout, so every line shows.
  • src/draw.c — in debug mode, log the resolved capture config to the OBS log (Help → Log Files): input source, source dimensions, crop (L/T/R/B), 180° rotation and channel.
  • src/feature_flags.{h,cpp} — FEATURE_DEBUG key.
  • src/SettingsDialog.{cpp,hpp} — the toggle, under Advanced features.
  • README + all translations (es/fr/jp/pt-br) document it.

Why

Diagnosing a "nothing is detected" situation otherwise means guessing. With debug on, the dock immediately shows whether the deck paths resolved, what channel/thresholds were used, and the full backend output, while the OBS log shows the capture framing — turning a long back-and-forth into a glance.

Scope / risk

Opt-in and off by default; with it off, logging is exactly as before. No behaviour change beyond logging verbosity.

How it was tested

  • Universal plugin build succeeds (cmake --preset macos).
  • With the toggle on, the dock log shows the backend launch line + unfiltered backend output, and the OBS log shows the capture config; with it off, output is unchanged.

Debug logging in action

On — the dock shows the resolved backend launch (· [P1] debug: lines: python path, model/channel/confidence/thresholds, deck-list paths) followed by every backend line unfiltered (HF Hub notice, use_fast, weight-loading progress — normally hidden):

Dock log with debug logging ON

Off (default) — only the meaningful lines, filtered:

Dock log with debug logging OFF

Three opt-in per-source detector-input aids (off by default), so the
plugin behaves like upstream until enabled:

- feature_flags.{h,cpp}: opt-in toggle infrastructure (draw_feature_enabled,
  backed by QSettings) with FEATURE_CROP / FEATURE_ROTATE.
- draw.c: when enabled, the DRAW source gains Crop (L/T/R/B px) and a 180°
  rotation, applied to the captured frame before the detector; plus a
  'Preview detector input' toggle that renders the cropped/rotated frame in
  the source itself (so the crop can be dialed in from the source's own
  preview) instead of the detected-card overlay. Detection keeps running.
- SettingsDialog: 'Enable detector input crop' / 'Enable 180° input rotation'
  toggles under 'Advanced features'.
- README + all translations and fr/ja locale strings.

Default (off) behaviour is identical to upstream.
Add an opt-in 'Enable debug logging' toggle (Advanced features, off by
default) that surfaces diagnostics without code edits:

- DrawDock: in debug mode, log the exact backend launch to the dock
  (resolved deck paths, channel, model, confidence, screen-time
  thresholds) and stop filtering the backend's stdout (show every line).
- draw.c: in debug mode, log the resolved capture config to the OBS log
  (input source, source dimensions, crop, 180° rotation, channel).
- feature_flags: FEATURE_DEBUG key.
- SettingsDialog: the toggle. README + all translations document it.

Plugin-side only; default (off) behaviour is unchanged.
HichTala and others added 16 commits October 12, 2026 12:15
…t's now the standard way to call cpp code from `draw.c` file

also disable to button when the preview is live
feat: opt-in detector input crop and 180° rotation
Three opt-in per-source detector-input aids (off by default), so the
plugin behaves like upstream until enabled:

- feature_flags.{h,cpp}: opt-in toggle infrastructure (draw_feature_enabled,
  backed by QSettings) with FEATURE_CROP / FEATURE_ROTATE.
- draw.c: when enabled, the DRAW source gains Crop (L/T/R/B px) and a 180°
  rotation, applied to the captured frame before the detector; plus a
  'Preview detector input' toggle that renders the cropped/rotated frame in
  the source itself (so the crop can be dialed in from the source's own
  preview) instead of the detected-card overlay. Detection keeps running.
- SettingsDialog: 'Enable detector input crop' / 'Enable 180° input rotation'
  toggles under 'Advanced features'.
- README + all translations and fr/ja locale strings.

Default (off) behaviour is identical to upstream.
Add an opt-in 'Enable debug logging' toggle (Advanced features, off by
default) that surfaces diagnostics without code edits:

- DrawDock: in debug mode, log the exact backend launch to the dock
  (resolved deck paths, channel, model, confidence, screen-time
  thresholds) and stop filtering the backend's stdout (show every line).
- draw.c: in debug mode, log the resolved capture config to the OBS log
  (input source, source dimensions, crop, 180° rotation, channel).
- feature_flags: FEATURE_DEBUG key.
- SettingsDialog: the toggle. README + all translations document it.

Plugin-side only; default (off) behaviour is unchanged.
…-debug-mode

# Conflicts:
#	data/locale/en-US.ini
#	data/locale/fr-FR.ini
#	data/locale/ja-JP.ini
#	src/SettingsDialog.cpp
#	src/SettingsDialog.hpp
#	src/bridge.h
- draw.c: the debug log still printed rotate_180, which no longer exists
  (build error); log crop + channel only.
- en-US.ini: restore the crop/preview labels from HichTala#28 that the master
  merge reverted.
- README_jp.md: remove the duplicated Advanced features block.
- READMEs: debug log details mention crop only (no rotation).
- DrawDock.cpp: include bridge.h.
- clang-format.
…-debug-mode

# Conflicts:
#	data/locale/en-US.ini
#	readmes/README_jp.md

@HichTala HichTala left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, can be merged

@HichTala
HichTala merged commit a6595da into HichTala:master Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants