-
Notifications
You must be signed in to change notification settings - Fork 4
[FSSDK-11853] add flutter logger support #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
muzahidul-opti
wants to merge
15
commits into
master
Choose a base branch
from
muzahid/custom-looger
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add FlutterOptimizelyLogger class implementing OPTLogger protocol - Add constants for customLogger and loggerChannel - Implement FlutterMethodChannel for invoking log method - Add logger field to OptimizelyFlutterSdk constructor - Initialize custom logger in OptimizelyClientWrapper - Create LoggerBridge to handle log method calls - Implement OptimizelyLogger interface and DefaultOptimizelyLogger class
- Update custom logger initialization in OptimizelyFlutterSdkPlugin - Adjust logger channel setup in onDetachedFromEngine - Refactor LoggerBridge to handle log calls from native Swift/Java code properly - Ensure proper logging when no custom logger is set
- Rename 'OptimizelyLogger.dart' to 'flutter_logger.dart' - Rename 'LoggerBridge.dart' to 'logger_bridge.dart' - Modify imports in 'optimizely_client_wrapper.dart' to reflect changes in logger files
- Implement a custom logger class - Define logLevel property with default debug level - Define log method to print log messages with custom format
- Rename FlutterOptimizelyLogger to OptimizelyFlutterLogger in Android - Rename FlutterOptimizelyLogger to OptimizelyFlutterLogger in iOS
- Remove unused log level property in CustomLogger - Implement channel setter method in OptimizelyFlutterLogger - Add guard clauses for levels and logger channel availability in log method - Update channel invocation to happen on main thread - Set log level in SwiftOptimizelyFlutterSdkPlugin based on parameters - Simplify DefaultOptimizelyLogger log method - Update log message formatting in logger bridge for consistency
- 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
- Define LOGGER_CHANNEL constant for OptimizelyFlutterLogger class - Set up separate FlutterMethodChannel for outgoing log calls - Update SwiftOptimizelyFlutterSdkPlugin to use the new logger channel
- Add DispatchQueue.main.async for each method call to ensure platform channel messages are sent on the correct thread
- Remove unnecessary comments and TODOs - Replace direct print statements with AppLogger methods - Refactor AppLogger to enhance flexibility and ease of use
- Remove comparison to Swift's DispatchQueue.main.async
- Remove import statement for 'log_level' that is no longer used - Update import paths for 'flutter_logger' and 'optimizely_flutter_sdk' test: update test cases in logger_test.dart - Update test cases to use 'const MethodCall' for creating method calls - Change null and empty arguments to be created and handled correctly - Fix missing level or message argument handling scenarios - Improve handling of invalid level data types in method calls docs: add comments to improve code clarity in logger_test.dart - Add comments explaining the purpose of each test group and case - Include comments for the different scenarios being tested in each case
- Update log message format in CustomLogger class - Refactor main thread dispatch logic for method channel calls in Utils.swift - Enhance error handling and main thread dispatch in OptimizelyFlutterLogger.swift - Modify method channel creation and task queue handling in SwiftOptimizelyFlutterSdkPlugin.swift
- Replace usage of static AppLogger class with separate logging functions - Introduce individual logger functions for error, warning, info, and debug levels - Create a default stand-alone logger instance to handle logging operations
- Test calling global logging functions without errors - Test handling empty messages in global functions - Test handling special characters in global functions - Test handling rapid calls to global functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Issues