gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 01/24: Logging


From: gnunet
Subject: [taler-taler-ios] 01/24: Logging
Date: Tue, 05 Dec 2023 16:25:57 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit 95c1c61675743c30f7d1def64cf7f103108f523e
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Nov 23 17:19:37 2023 +0100

    Logging
---
 TalerWallet1/Backend/WalletCore.swift     |  6 +++---
 TalerWallet1/Controllers/DebugViewC.swift | 24 +++++++++++-------------
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/TalerWallet1/Backend/WalletCore.swift 
b/TalerWallet1/Backend/WalletCore.swift
index 8c8ebde..76ba1ab 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -153,7 +153,7 @@ extension WalletCore {
                                  userInfo: [AnyHashable: Any]? = nil) {
         Task { // runs on MainActor
             await postNotificationM(aName, object: anObject, userInfo: 
userInfo)
-            logger.log("Notification sent: \(aName.rawValue)")
+            logger.info("Notification sent: \(aName.rawValue)")
         }
     }
 
@@ -200,7 +200,7 @@ extension WalletCore {
                             postNotification(.TransactionDone, userInfo: 
[TRANSACTIONTRANSITION: decoded])
                             return
                         case .expired:
-                            logger.log("Expired: \(decoded.transactionId, 
privacy: .private(mask: .hash))")
+                            logger.warning("Expired: \(decoded.transactionId, 
privacy: .private(mask: .hash))")
                             Controller.shared.playSound(0)
                             postNotification(.TransactionExpired, userInfo: 
[TRANSACTIONTRANSITION: decoded])
                             return
@@ -224,7 +224,7 @@ extension WalletCore {
                             logger.log("Pending: \(decoded.transactionId, 
privacy: .private(mask: .hash))")
                             postNotification(.TransactionStateTransition, 
userInfo: [TRANSACTIONTRANSITION: decoded])
                         default:
-                            logger.log("Yikes: \(decoded.transactionId, 
privacy: .private(mask: .hash))")
+                            logger.warning("Unknow transition: 
\(decoded.transactionId, privacy: .private(mask: .hash))")
                             postNotification(.TransactionStateTransition, 
userInfo: [TRANSACTIONTRANSITION: decoded])
                     } // switch
                 } // type
diff --git a/TalerWallet1/Controllers/DebugViewC.swift 
b/TalerWallet1/Controllers/DebugViewC.swift
index b135dfd..fd6551b 100644
--- a/TalerWallet1/Controllers/DebugViewC.swift
+++ b/TalerWallet1/Controllers/DebugViewC.swift
@@ -170,31 +170,29 @@ class DebugViewC: ObservableObject {
                 logger.log("\(newID, privacy: .public) stays")
                 // don't set viewID to the same value, it would just trigger 
an unneccessary redraw
             }
-        } else if viewID > 0 {
-            logger.log("switching OFF, will not use \(newID, privacy: 
.public)")
-            viewID = 0                                      // publish OFF
         } else {
-            logger.log("off, will not use \(newID, privacy: .public)")
-            // don't set viewID from 0 to 0 again, it would just trigger an 
unneccessary redraw
+            logger.log("view \(newID, privacy: .public)")
+            if viewID > 0 {
+                viewID = 0                                      // publish OFF
+            }
         }
     }
     
     @MainActor func setSheetID(_ newID: Int) -> Void {
         if developerMode {
             if sheetID != newID {
-                logger.log("switching from \(self.sheetID, privacy: .public) 
to \(newID, privacy: .public) for sheet")
+                logger.log("sheet switching from \(self.sheetID, privacy: 
.public) to \(newID, privacy: .public)")
                 sheetID = newID                             // publish new 
sheetID
             } else {
-                logger.log("\(newID, privacy: .public) stays for sheet")
+                logger.log("sheet \(newID, privacy: .public) stays")
                 // don't set sheetID to the same value, it would just trigger 
an unneccessary redraw
             }
-        } else if sheetID > 0 {
-            // might happen after switching DevMode off, if sheetID still has 
the old value of the last sheet
-            logger.log("switching OFF, will not use \(newID, privacy: .public) 
for sheet")
-            sheetID = 0                                     // publish OFF
         } else {
-            logger.log("off, will not use \(newID, privacy: .public) for 
sheet")
-            // don't set sheetID from 0 to 0 again, it would just trigger an 
unneccessary redraw
+            logger.log("sheet \(newID, privacy: .public)")
+            if sheetID > 0 {
+                // might happen after switching DevMode off, if sheetID still 
has the old value of the last sheet
+                sheetID = 0                                     // publish OFF
+            }
         }
     }
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]