瀏覽代碼

decrease logging
* disable some debug logging when AppleHealth and Dynamic features are enabled

marionbarker 1 年之前
父節點
當前提交
7106a919e9
共有 2 個文件被更改,包括 25 次插入25 次删除
  1. 1 1
      FreeAPS/Sources/APS/DeviceDataManager.swift
  2. 24 24
      FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift

+ 1 - 1
FreeAPS/Sources/APS/DeviceDataManager.swift

@@ -459,7 +459,7 @@ extension BaseDeviceDataManager: PumpManagerDelegate {
         completion: @escaping (_ error: Error?) -> Void
     ) {
         dispatchPrecondition(condition: .onQueue(processQueue))
-        debug(.deviceManager, "New pump events:\n\(events.map(\.title).joined(separator: "\n"))")
+        // debug(.deviceManager, "New pump events:\n\(events.map(\.title).joined(separator: "\n"))")
 
         // filter buggy TBRs > maxBasal from MDT
         let events = events.filter {

+ 24 - 24
FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift

@@ -169,12 +169,12 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
 
             healthKitStore.save(samplesToSave) { (success: Bool, error: Error?) -> Void in
                 if success {
-                    for sample in samplesToSave {
-                        debug(
-                            .service,
-                            "Stored blood glucose \(sample.quantity) in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
-                        )
-                    }
+                    // for sample in samplesToSave {
+                    //     debug(
+                    //         .service,
+                    //         "Stored blood glucose \(sample.quantity) in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
+                    //     )
+                    // }
                 } else {
                     debug(.service, "Failed to store blood glucose in HealthKit Store!")
                     debug(.service, error?.localizedDescription ?? "Unknown error")
@@ -221,12 +221,12 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
 
             healthKitStore.save(samplesToSave) { (success: Bool, error: Error?) -> Void in
                 if success {
-                    for sample in samplesToSave {
-                        debug(
-                            .service,
-                            "Stored carb entry \(sample.quantity) in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
-                        )
-                    }
+                    // for sample in samplesToSave {
+                    //    debug(
+                    //        .service,
+                    //        "Stored carb entry \(sample.quantity) in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
+                    //    )
+                    // }
                 } else {
                     debug(.service, "Failed to store carb entry in HealthKit Store!")
                     debug(.service, error?.localizedDescription ?? "Unknown error")
@@ -297,12 +297,12 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
 
             healthKitStore.save(bolusSamples + basalSamples) { (success: Bool, error: Error?) -> Void in
                 if success {
-                    for sample in bolusSamples + basalSamples {
-                        debug(
-                            .service,
-                            "Stored insulin entry in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
-                        )
-                    }
+                    // for sample in bolusSamples + basalSamples {
+                    //    debug(
+                    //    .service,
+                    //        "Stored insulin entry in HealthKit Store! Metadata: \(String(describing: sample.metadata?.values))"
+                    //    )
+                    // }
                 } else {
                     debug(.service, "Failed to store insulin entry in HealthKit Store!")
                     debug(.service, error?.localizedDescription ?? "Unknown error")
@@ -491,7 +491,7 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
 
     private func prepareBGSamplesToPublisherFetch(_ samples: [HKQuantitySample]) {
         dispatchPrecondition(condition: .onQueue(processQueue))
-        debug(.service, "Start preparing samples: \(String(describing: samples))")
+        // debug(.service, "Start preparing samples: \(String(describing: samples))")
 
         newGlucose += samples
             .compactMap { sample -> HealthKitSample? in
@@ -521,10 +521,10 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
 
         newGlucose = newGlucose.removeDublicates()
 
-        debug(
-            .service,
-            "Current BloodGlucose.Type objects will be send from Publisher during fetch: \(String(describing: newGlucose))"
-        )
+        // debug(
+        //    .service,
+        //    "Current BloodGlucose.Type objects will be send from Publisher during fetch: \(String(describing: newGlucose))"
+        // )
     }
 
     // MARK: - GlucoseSource
@@ -542,7 +542,7 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
             self.processQueue.async {
                 //   debug(.service, "Start fetching HealthKitManager")
                 guard self.settingsManager.settings.useAppleHealth else {
-                    debug(.service, "HealthKitManager cant return any data, because useAppleHealth option is disable")
+                    // debug(.service, "HealthKitManager can't return any data, because useAppleHealth option is disabled")
                     promise(.success([]))
                     return
                 }