瀏覽代碼

tweak logging

B. Petersen 4 年之前
父節點
當前提交
14612ec3d0
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      deltachat-ios/AppDelegate.swift

+ 3 - 4
deltachat-ios/AppDelegate.swift

@@ -303,10 +303,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     ) {
         let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
         let tokenString = tokenParts.joined()
-        print("Device Token: \(tokenString)")
-
-        // TODO: persist token in config
-        // and post token to notification server only on changes
+        logger.verbose("device token: \(tokenString)")
 
         if let url = URL(string: "https://notifications.delta.chat/register?token=\(tokenString)") {
             var request = URLRequest(url: url)
@@ -321,6 +318,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                 logger.info("request to notification server succeeded with respose, data: \(String(describing: response)), \(String(describing: data))")
             }
             task.resume()
+        } else {
+            logger.error("cannot create URL for token: \(tokenString)")
         }
     }