commit 0222d2130cd08d65d9c33d98be856650219979ce parent fdc73097f1a556c9d22d68ec85a23df3e69ad18f Author: Marc Stibane <marc@taler.net> Date: Tue, 20 Jun 2023 09:03:55 +0200 Reduce Logging Diffstat:
18 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/TalerWallet1/Backend/WalletCore.swift b/TalerWallet1/Backend/WalletCore.swift @@ -139,16 +139,16 @@ extension WalletCore { private func postNotificationM(_ aName: NSNotification.Name, object anObject: Any? = nil, userInfo: [AnyHashable: Any]? = nil) async { - symLog.log(aName.rawValue) NotificationCenter.default.post(name: aName, object: anObject, userInfo: userInfo) } private func postNotification(_ aName: NSNotification.Name, object anObject: Any? = nil, userInfo: [AnyHashable: Any]? = nil) { Task { + if let userInfo { symLog.log(userInfo) } else { symLog.log(aName) } await postNotificationM(aName, object: anObject, userInfo: userInfo) + symLog.log("sent " + aName.rawValue) } - if let userInfo { symLog.log(userInfo) } else { symLog.log(aName) } } private func handlePendingProcessed(_ payload: Payload) throws { @@ -223,7 +223,7 @@ print("\n❗️ \(pendingOp): \(id)\n") // this is a new pendingOp I have "refresh-revealed", "refresh-unwarranted": break default: -print("\n❗️ ", anyPayload, "\n") // this is a new notification I haven't seen before +print("\n❗️ WalletCore.swift:226 Notification: ", anyPayload, "\n") // this is a new notification I haven't seen before break } } catch let error { diff --git a/TalerWallet1/Controllers/DebugViewC.swift b/TalerWallet1/Controllers/DebugViewC.swift @@ -90,7 +90,7 @@ public let SHEET_RCV_P2P = SHEET_PAY_P2P + 10 // 170 Recei // MARK: - struct DebugViewV: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) @EnvironmentObject private var debugViewC: DebugViewC var body: some View { @@ -113,7 +113,7 @@ struct DebugViewV: View { } // MARK: - class DebugViewC: ObservableObject { - private let symLog = SymLogC() // 0 to switch off viewID change logging + private let symLog = SymLogC(0) // 0 to switch off viewID change logging public static let shared = DebugViewC() @AppStorage("developerMode") var developerMode: Bool = false diff --git a/TalerWallet1/Controllers/TalerWallet1App.swift b/TalerWallet1/Controllers/TalerWallet1App.swift @@ -45,27 +45,27 @@ struct TalerWallet1App: App { symLog.log("task -> initWalletCore done") } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification, object: nil)) { _ in - print("❗️App Did Become Active notification") + symLog.log("❗️App Did Become Active notification") } .onReceive(NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification, object: nil)) { _ in - print("❗️App Will Resign notification") + symLog.log("❗️App Will Resign notification") isActive = false } .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification, object: nil)) { _ in - print("❗️App Will Enter Foreground notification") + symLog.log("❗️App Will Enter Foreground notification") isActive = true } .onReceive(NotificationCenter.default.publisher(for: UIApplication.willTerminateNotification, object: nil)) { _ in - print("❗️App Will Terminate notification") + symLog.log("❗️App Will Terminate notification") } } .onChange(of: phase) { newPhase in switch newPhase { case .active: - print("❗️ .onChange(of: phase) ==> newPhase: Active") + symLog.log("❗️ .onChange(of: phase) ==> newPhase: Active") case .background: - print("❗️ .onChange(of: phase) ==> newPhase: Background)") + symLog.log("❗️ .onChange(of: phase) ==> newPhase: Background)") scheduleAppRefresh() default: break } diff --git a/TalerWallet1/Model/BalancesModel.swift b/TalerWallet1/Model/BalancesModel.swift @@ -10,7 +10,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class BalancesModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } // MARK: - diff --git a/TalerWallet1/Model/ExchangeModel.swift b/TalerWallet1/Model/ExchangeModel.swift @@ -9,7 +9,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class ExchangeModel: WalletModel { override init(_ symbol: Int = -1) { - super.init(symbol) + super.init(0)//symbol) } } // MARK: - diff --git a/TalerWallet1/Model/PaymentURIModel.swift b/TalerWallet1/Model/PaymentURIModel.swift @@ -11,7 +11,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class PaymentURIModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } // MARK: - ContractTerms diff --git a/TalerWallet1/Model/Peer2peerModel.swift b/TalerWallet1/Model/Peer2peerModel.swift @@ -10,7 +10,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class Peer2peerModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } // MARK: - PeerContractTerms diff --git a/TalerWallet1/Model/PendingModel.swift b/TalerWallet1/Model/PendingModel.swift @@ -11,7 +11,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class PendingModel: WalletModel { override init(_ symbol: Int = -1) { - super.init(symbol) + super.init(0)//symbol) } } // MARK: - diff --git a/TalerWallet1/Model/SettingsModel.swift b/TalerWallet1/Model/SettingsModel.swift @@ -16,7 +16,7 @@ fileprivate let DEMO_MERCHANTAUTHTOKEN = "secret-token:sandbox" // MARK: - class SettingsModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } // MARK: - diff --git a/TalerWallet1/Model/TransactionsModel.swift b/TalerWallet1/Model/TransactionsModel.swift @@ -33,7 +33,7 @@ class TransactionsModel: WalletModel { } override init(_ symbol: Int = -1) { - super.init(symbol) + super.init(0)//symbol) } } diff --git a/TalerWallet1/Model/WalletInitModel.swift b/TalerWallet1/Model/WalletInitModel.swift @@ -9,7 +9,7 @@ private let DATABASE = "talerwalletdb-v30" class WalletInitModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } // MARK: - diff --git a/TalerWallet1/Model/WithdrawModel.swift b/TalerWallet1/Model/WithdrawModel.swift @@ -10,7 +10,7 @@ fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for debugging class WithdrawModel: WalletModel { override init(_ symbol: Int = -1) { // init with 0 to disable logging for this class - super.init(symbol) + super.init(0)//symbol) } } diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift @@ -10,7 +10,7 @@ import AVFoundation /// This view shows the list of balances / currencies, each in its own section struct BalancesListView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) let navTitle: String @State var balances: [Balance] = [] diff --git a/TalerWallet1/Views/Exchange/ExchangeListView.swift b/TalerWallet1/Views/Exchange/ExchangeListView.swift @@ -8,7 +8,7 @@ import SymLog /// This view shows the list of exchanges struct ExchangeListView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) let navTitle: String var model: ExchangeModel? diff --git a/TalerWallet1/Views/Main/ErrorView.swift b/TalerWallet1/Views/Main/ErrorView.swift @@ -6,7 +6,7 @@ import SwiftUI import SymLog struct ErrorView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) let errortext: String? diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift @@ -14,7 +14,7 @@ struct LazyView<Content: View>: View { } struct MainView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) @EnvironmentObject private var viewState: ViewState // popToRootView() @EnvironmentObject private var controller: Controller @State private var sheetPresented = false diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift b/TalerWallet1/Views/Main/WalletEmptyView.swift @@ -9,7 +9,7 @@ import SymLog /// It is the very first thing the user sees after installing the app struct WalletEmptyView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic var body: some View { diff --git a/TalerWallet1/Views/Settings/SettingsView.swift b/TalerWallet1/Views/Settings/SettingsView.swift @@ -18,7 +18,7 @@ import SymLog */ struct SettingsView: View { - private let symLog = SymLogV() + private let symLog = SymLogV(0) let navTitle: String @AppStorage("developerMode") var developerMode: Bool = false