Skip to content

Commit bde2659

Browse files
feat: add methods and tests for logger state management
- Add methods to expose converting log level, checking if a custom logger is set, retrieving the current logger, and resetting the logger state - Implement a method for simulating method calls - Add tests for maintaining logger state across multiple operations - Include a test for handling logger replacement - Create tests for edge cases including handling empty messages and special characters
1 parent 8b401ca commit bde2659

File tree

2 files changed

+491
-0
lines changed

2 files changed

+491
-0
lines changed

lib/src/logger/logger_bridge.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,29 @@ class LoggerBridge {
7474
return OptimizelyLogLevel.info;
7575
}
7676
}
77+
78+
/// Expose convertLogLevel
79+
static OptimizelyLogLevel convertLogLevel(int rawValue) {
80+
return _convertLogLevel(rawValue);
81+
}
82+
83+
/// Check if a custom logger is set
84+
static bool hasLogger() {
85+
return _customLogger != null;
86+
}
87+
88+
/// Get the current logger
89+
static OptimizelyLogger? getCurrentLogger() {
90+
return _customLogger;
91+
}
92+
93+
/// Reset logger state
94+
static void reset() {
95+
_customLogger = null;
96+
}
97+
98+
/// Simulate method calls
99+
static Future<void> handleMethodCallForTesting(MethodCall call) async {
100+
await _handleMethodCall(call);
101+
}
77102
}

0 commit comments

Comments
 (0)