From dedf38bd890606b2360c6aac3ef3b6b275edd1e2 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Sat, 23 Mar 2024 16:43:03 +0300 Subject: [PATCH] Filter out node logs below Debug level on extensions --- .../main/kotlin/com/cBreez/client/BreezForegroundService.kt | 3 ++- .../NotificationService.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/com/cBreez/client/BreezForegroundService.kt b/android/app/src/main/kotlin/com/cBreez/client/BreezForegroundService.kt index a6e6951a5..31a3e2770 100644 --- a/android/app/src/main/kotlin/com/cBreez/client/BreezForegroundService.kt +++ b/android/app/src/main/kotlin/com/cBreez/client/BreezForegroundService.kt @@ -4,6 +4,7 @@ import android.content.SharedPreferences import breez_sdk.ConnectRequest import breez_sdk.EnvironmentType import breez_sdk.GreenlightNodeConfig +import breez_sdk.LevelFilter import breez_sdk.LogEntry import breez_sdk.NodeConfig import breez_sdk.defaultConfig @@ -33,7 +34,7 @@ class BreezForegroundService : ForegroundService() { super.onCreate() Logger.tag(TAG).debug { "Creating Breez foreground service..." } registerNotificationChannels(applicationContext, DEFAULT_CLICK_ACTION) - val sdkLogListener = SdkLogInitializer.initializeNodeLogStream() + val sdkLogListener = SdkLogInitializer.initializeNodeLogStream(LevelFilter.DEBUG) sdkLogListener.subscribe(serviceScope) { l: LogEntry -> when (l.level) { "ERROR" -> Logger.tag(TAG).error { l.line } diff --git a/ios/Breez Notification Service Extension/NotificationService.swift b/ios/Breez Notification Service Extension/NotificationService.swift index aaeb56c0d..dd4f90e7e 100644 --- a/ios/Breez Notification Service Extension/NotificationService.swift +++ b/ios/Breez Notification Service Extension/NotificationService.swift @@ -31,7 +31,7 @@ class NotificationService: SDKNotificationService { setLogger(logger: logger) // Use the same SdkLogListener(:LogStream) to listen in on BreezSDK node logs do { - try setLogStream(logStream: logger) + try setLogStream(logStream: logger, filterLevel: LevelFilter.debug) } catch let e { self.logger.log(tag: TAG, line:"Failed to set log stream: \(e)", level: "ERROR") }