Skip to content

fix(logging): route bypassed log writes through DebugLogger - #1093

Open
bunnysayzz wants to merge 1 commit into
altic-dev:mainfrom
bunnysayzz:fix/log-bypass-debug-logger-1056
Open

bunnysayzz wants to merge 1 commit into
altic-dev:mainfrom
bunnysayzz:fix/log-bypass-debug-logger-1056

Conversation

@bunnysayzz

Copy link
Copy Markdown

Description

Three logging paths bypass DebugLogger and write straight to Fluid.log (and stdout) even when diagnostics are off:

  • DirectCoreAudioInput's private log() called FileLogger.shared.append plus an unconditional print, so its ~30 lifecycle lines (device start/stop, listener registration, etc.) always landed in the file and on stdout in release builds.
  • TextSelectionService's diag() wrote to FileLogger directly and then also called DebugLogger.debug, so every line was written twice in debug builds and still hit the file in release.
  • RewriteModeService's appendDiagnosticLog() did the same double write (FileLogger plus DebugLogger.debug).

All three now go through DebugLogger: DirectCoreAudioInput maps its levels 1:1 (debug/info/warning), diag() is a single DebugLogger.debug call, and appendDiagnosticLog() keeps its existing runtime gate (RewriteModeDiagnosticsEnabled / FLUID_REWRITE_DIAGNOSTICS / FLUID_PROMPT_TRACE) but writes once via DebugLogger.info instead of twice.

Behavior after the change: .debug messages are dropped in release unless FLUIDVOICE_DIAGNOSTICS is set, the unconditional stdout print in DirectCoreAudioInput is gone (printing only happens in DEBUG builds, via DebugLogger), and the duplicate file lines in the other two call sites are gone. Nothing else changes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Chore
  • Documentation update

Related Issue or Discussion

Closes #1056

Testing

No macOS machine here, so this is parse-level verification only. I read every changed line, checked the DebugLogger API signatures (log/debug/info/warning, including the @autoclosure on debug), confirmed FileLogger.append is already async so the swap changes no ordering guarantees, and confirmed no other callers of the three changed helpers exist. Could not run the app, swiftlint, swiftformat, or the test suite locally.

Screenshots / Video

  • No UI/visual changes; screenshots/video are not applicable.

Notes

Used AI to draft the fix. I reviewed every changed line myself and take responsibility for the change.

  • A human created this PR or reviewed and approved it before submission, understands the full diff, and takes responsibility for the change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-09T10:37:48.339845Z 978b470 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; the three helpers follow the intended logging gates without changing their callers’ behavior.

Summary

Routes three logging helpers through DebugLogger, removing duplicate file writes and applying its existing debug gate.

  • Audio lifecycle logs retain their levels, source label, and uptime.
  • Rewrite diagnostics retain their runtime switches and write once through DebugLogger.info.
  • Selection diagnostics write once through DebugLogger.debug.
  • bunnysayzz explicitly described dropping debug messages in release and removing unconditional lifecycle console output as intended. These changes were not treated as regressions.
  • No actionable issues found. No runtime verification was performed.

Reviews (1) · Last reviewed commit: "fix(logging): route bypassed log writes ..." · Reviewed by Greptile

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.

[BUG] Some log writes bypass DebugLogger and are always written to Fluid.log (and stdout) in release builds

1 participant