[diagnostics]: Added switches for OperationLogging to use them for debugging/diagnostics on device

This commit is contained in:
Magesh K
2025-01-14 07:23:23 +05:30
parent abd3735ae4
commit 0da743e9a6
7 changed files with 485 additions and 82 deletions

View File

@@ -39,7 +39,8 @@ class ResultOperation<ResultType>: Operation
}
// Diagnostics: perform verbose logging of the operations only if enabled (so as to not flood console logs)
if UserDefaults.standard.isVerboseOperationsLoggingEnabled {
let isLoggingEnabledForThisOperation = OperationsLoggingControl.getFromDatabase(for: type(of: self))
if UserDefaults.standard.isVerboseOperationsLoggingEnabled && isLoggingEnabledForThisOperation {
// diagnostics logging
let resultStatus = String(describing: result).prefix("success".count).uppercased()
print("\n ====> OPERATION: `\(type(of: self))` completed with: \(resultStatus) <====\n\n" +