[cronet_http] Add support for NetLog (startNetLogToFile / stopNetLog)#1882
Open
himgupta wants to merge 2 commits intodart-lang:masterfrom
Open
[cronet_http] Add support for NetLog (startNetLogToFile / stopNetLog)#1882himgupta wants to merge 2 commits intodart-lang:masterfrom
himgupta wants to merge 2 commits intodart-lang:masterfrom
Conversation
This adds support for Cronet NetLog, allowing developers to capture network logs for debugging. Features: - `startNetLogToFile(String fileName, bool logAll)`: Starts logging to a file. - `stopNetLog()`: Stops logging. Includes integration tests. Co-authored-by: himgupta <648805+himgupta@users.noreply.github.com>
Add NetLog support to cronet_http
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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
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.
This PR adds support for Cronet's NetLog feature to the cronet_http package. This allows developers to capture detailed network logs to a file, which can be invaluable for debugging network issues and analyzing performance.
It exposes the following methods on CronetEngine:
startNetLogToFile(String fileName, bool logAll): Starts logging network events to the specified file.
stopNetLog(): Stops the logging session.
These methods map directly to the underlying Android Cronet API:
startNetLogToFile
stopNetLog
Changes
pkgs/cronet_http/lib/src/cronet_client.dart: Added startNetLogToFile and stopNetLog methods to the CronetEngine class.
pkgs/cronet_http/example/integration_test/net_log_test.dart: Added a new integration test to verify that the log file is created and populated when logging is enabled.
pkgs/cronet_http/pubspec.yaml: Bumped version to 1.9.0.
pkgs/cronet_http/CHANGELOG.md: Added an entry for the new feature.
Testing
Added a new integration test: pkgs/cronet_http/example/integration_test/net_log_test.dart.
Ran flutter analyze and dart format to ensure compliance with the repository standards.
Checklist
I have read the CONTRIBUTING.md guide.
I have updated the CHANGELOG.md.
I have bumped the package version in pubspec.yaml.
I have added tests to cover my changes.