Replace logger package with custom WASM-compatible modular logger#260
Merged
Replace logger package with custom WASM-compatible modular logger#260
Conversation
Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create custom modular logger with log levels
Replace logger package with custom WASM-compatible modular logger
Oct 23, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #260 +/- ##
==========================================
+ Coverage 68.58% 68.82% +0.23%
==========================================
Files 126 129 +3
Lines 4473 4507 +34
==========================================
+ Hits 3068 3102 +34
Misses 1405 1405 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1-leo
approved these changes
Oct 25, 2025
Contributor
|
we could think about moving this to its own package so we can use the logger in other ndk packages |
nogringo
approved these changes
Oct 25, 2025
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.
Problem
The
loggerpackage (v2.6.2) was preventing NDK from being used in WASM environments because it importsdart:iothrough its file output functionality. This created a dependency chain that made the entire library incompatible with web/WASM targets:Solution
Implemented a custom, modular logger that provides all the functionality we need without any platform-specific dependencies. The new logger is:
dart:iodependencyLogOutputinterface allows custom outputs (file, network, etc.)Key Changes
New Logger Components
LogLevel- Enum defining log levels with proper ordering and filteringLogEvent- Data class representing a log event (level, message, error, timestamp)LogOutput- Abstract interface for creating custom outputsNdkLogger- Core logger with level filtering and multiple output supportConsoleOutput- Default console output (maintains "NDK: " prefix)Migration
The logger maintains 100% API compatibility. Existing code works without changes:
Modular Output System
Users can now create custom outputs for different logging backends:
Testing
Added comprehensive test coverage for:
Documentation
lib/shared/logger/README.md- Complete usage guideexample/logger_example.dart- Working examples showing all featuresBreaking Changes
None. The implementation maintains 100% backward compatibility with the existing API.
Stats
logger: ^2.6.2dependencypackage:loggerordart:ioimports in logger chainFixes the WASM compatibility issue and makes the logger more flexible and maintainable.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)get.dart.devcurl -fsSL REDACTED -o /tmp/dart.zip(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.