Repository navigation
fix(logging): route bypassed log writes through DebugLogger - #1093
Open
bunnysayzz wants to merge 1 commit into
Open
bunnysayzz wants to merge 1 commit into
bunnysayzz wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three logging paths bypass
DebugLoggerand write straight toFluid.log(and stdout) even when diagnostics are off:DirectCoreAudioInput's privatelog()calledFileLogger.shared.appendplus an unconditionalprint, so its ~30 lifecycle lines (device start/stop, listener registration, etc.) always landed in the file and on stdout in release builds.TextSelectionService'sdiag()wrote toFileLoggerdirectly and then also calledDebugLogger.debug, so every line was written twice in debug builds and still hit the file in release.RewriteModeService'sappendDiagnosticLog()did the same double write (FileLoggerplusDebugLogger.debug).All three now go through
DebugLogger:DirectCoreAudioInputmaps its levels 1:1 (debug/info/warning),diag()is a singleDebugLogger.debugcall, andappendDiagnosticLog()keeps its existing runtime gate (RewriteModeDiagnosticsEnabled/FLUID_REWRITE_DIAGNOSTICS/FLUID_PROMPT_TRACE) but writes once viaDebugLogger.infoinstead of twice.Behavior after the change:
.debugmessages are dropped in release unlessFLUIDVOICE_DIAGNOSTICSis set, the unconditional stdout print inDirectCoreAudioInputis gone (printing only happens in DEBUG builds, viaDebugLogger), and the duplicate file lines in the other two call sites are gone. Nothing else changes.Type of Change
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
DebugLoggerAPI signatures (log/debug/info/warning, including the@autoclosureondebug), confirmedFileLogger.appendis 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
Notes
Used AI to draft the fix. I reviewed every changed line myself and take responsibility for the change.