mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 19:23:43 +01:00
[diagnostics]: make operations logging into console to be conditional, toggled by a switch in settings
This commit is contained in:
@@ -38,10 +38,13 @@ class ResultOperation<ResultType>: Operation
|
||||
result = .failure(error)
|
||||
}
|
||||
|
||||
// diagnostics logging
|
||||
let resultStatus = String(describing: result).prefix("success".count).uppercased()
|
||||
print("\n ====> OPERATION: `\(type(of: self))` completed with: \(resultStatus) <====\n\n" +
|
||||
" Result: \(result)\n")
|
||||
// Diagnostics: perform verbose logging of the operations only if enabled (so as to not flood console logs)
|
||||
if UserDefaults.standard.isVerboseOperationsLoggingEnabled {
|
||||
// diagnostics logging
|
||||
let resultStatus = String(describing: result).prefix("success".count).uppercased()
|
||||
print("\n ====> OPERATION: `\(type(of: self))` completed with: \(resultStatus) <====\n\n" +
|
||||
" Result: \(result)\n")
|
||||
}
|
||||
|
||||
self.resultHandler?(result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user