Skip to content

Commit 6993bfc

Browse files
feat: add separate logger channel for outgoing log calls
- Define LOGGER_CHANNEL constant for OptimizelyFlutterLogger class - Set up separate FlutterMethodChannel for outgoing log calls - Update SwiftOptimizelyFlutterSdkPlugin to use the new logger channel
1 parent bde2659 commit 6993bfc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ios/Classes/OptimizelyFlutterLogger.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Flutter
22
import Optimizely
33

44
public class OptimizelyFlutterLogger: NSObject, OPTLogger {
5+
static var LOGGER_CHANNEL: String = "optimizely_flutter_sdk_logger";
6+
57
public static var logLevel: OptimizelyLogLevel = .info
68

79
private static var loggerChannel: FlutterMethodChannel?

ios/Classes/SwiftOptimizelyFlutterSdkPlugin.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public class SwiftOptimizelyFlutterSdkPlugin: NSObject, FlutterPlugin {
4343
channel = FlutterMethodChannel(name: "optimizely_flutter_sdk", binaryMessenger: registrar.messenger())
4444
let instance = SwiftOptimizelyFlutterSdkPlugin()
4545
registrar.addMethodCallDelegate(instance, channel: channel)
46+
47+
// Separate logger channel for outgoing log calls
48+
let loggerChannel = FlutterMethodChannel(name: OptimizelyFlutterLogger.LOGGER_CHANNEL, binaryMessenger: registrar.messenger())
49+
OptimizelyFlutterLogger.setChannel(loggerChannel)
4650
}
4751

4852
/// Part of FlutterPlugin protocol to handle communication with flutter sdk

0 commit comments

Comments
 (0)