Skip to content

Comments

[cronet_http] Add support for NetLog (startNetLogToFile / stopNetLog)#1882

Open
himgupta wants to merge 2 commits intodart-lang:masterfrom
himgupta:master
Open

[cronet_http] Add support for NetLog (startNetLogToFile / stopNetLog)#1882
himgupta wants to merge 2 commits intodart-lang:masterfrom
himgupta:master

Conversation

@himgupta
Copy link

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.

google-labs-jules bot and others added 2 commits February 18, 2026 16:19
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>
@google-cla
Copy link

google-cla bot commented Feb 20, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant