mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
Make Enable Logging the master switch over all verbose logging
The verbose toggles (MPV, remote control) kept working with the master "Enable Logging" toggle off: the settings UI hides them, but their stored values - verboseMPVLogging is even iCloud-synced - were still honored at runtime, producing console output and enabling the periodic MPV stats collection while logging appeared disabled. Enable Logging now takes precedence everywhere: - LoggingService gates its DEBUG-build OSLog console output on the master toggle (it previously ran before the isEnabled guard, so the Xcode console was never silent) - MPVLogging requires loggingEnabled && verboseMPVLogging, which also gates the 10s playback stats task via MPVLogging.verboseEnabled - rcDebug in LocalNetworkService and RemoteControlCoordinator requires the master toggle alongside verboseRemoteControlLogging
This commit is contained in:
@@ -92,8 +92,10 @@ final class LocalNetworkService {
|
||||
}
|
||||
|
||||
/// Log debug-level message. Only logs if verbose remote control logging is enabled.
|
||||
/// The master "Enable Logging" toggle takes precedence over the verbose flag.
|
||||
private func rcDebug(_ operation: String, _ message: String) {
|
||||
guard UserDefaults.standard.bool(forKey: "verboseRemoteControlLogging") else { return }
|
||||
guard UserDefaults.standard.bool(forKey: "loggingEnabled"),
|
||||
UserDefaults.standard.bool(forKey: "verboseRemoteControlLogging") else { return }
|
||||
let fullMessage = "[RemoteControl] \(operation) - \(message)"
|
||||
LoggingService.shared.logRemoteControlDebug(fullMessage)
|
||||
}
|
||||
|
||||
@@ -116,8 +116,10 @@ final class RemoteControlCoordinator {
|
||||
}
|
||||
|
||||
/// Log debug-level message. Only logs if verbose remote control logging is enabled.
|
||||
/// The master "Enable Logging" toggle takes precedence over the verbose flag.
|
||||
private func rcDebug(_ operation: String, _ message: String) {
|
||||
guard UserDefaults.standard.bool(forKey: "verboseRemoteControlLogging") else { return }
|
||||
guard UserDefaults.standard.bool(forKey: "loggingEnabled"),
|
||||
UserDefaults.standard.bool(forKey: "verboseRemoteControlLogging") else { return }
|
||||
let fullMessage = "[RemoteControl] \(operation) - \(message)"
|
||||
LoggingService.shared.logRemoteControlDebug(fullMessage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user