feat(logging): add LogManager.extend() for custom driver registration#36
Merged
anilcancakir merged 2 commits intomasterfrom Apr 5, 2026
Merged
feat(logging): add LogManager.extend() for custom driver registration#36anilcancakir merged 2 commits intomasterfrom
anilcancakir merged 2 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR adds extension points to the Magic framework’s logging and networking subsystems, enabling app-level customization (custom LoggerDriver registration and direct Dio configuration) while keeping config-driven resolution intact.
Changes:
- Add
LogManager.extend()(static registry) to register customLoggerDriverfactories, resolved before built-in drivers. - Add
DioNetworkDriver.configureDriver()to expose the underlyingDioinstance for SDK/plugin integration. - Add tests + docs + changelog entries covering both extension hooks.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/src/logging/log_manager.dart |
Adds static custom-driver registry (extend/resetDrivers) and resolves custom drivers before built-ins. |
lib/src/network/drivers/dio_network_driver.dart |
Adds configureDriver() hook to mutate the underlying Dio instance. |
test/logging/logging_test.dart |
Adds coverage for LogManager.extend() behavior (config passed, overrides built-ins, stack inclusion). |
test/network/network_test.dart |
Adds coverage for DioNetworkDriver.configureDriver() invocation behavior. |
doc/digging-deeper/logging.md |
Updates custom driver registration docs to use LogManager.extend(). |
doc/basics/http-client.md |
Documents the new configureDriver() plugin hook usage. |
skills/magic-framework/references/secondary-systems.md |
Adds reference docs for custom log drivers + example config. |
skills/magic-framework/references/http-network.md |
Adds reference docs for the Dio driver plugin hook. |
CHANGELOG.md |
Records both features under Unreleased. |
anilcancakir
added a commit
that referenced
this pull request
Apr 5, 2026
…cy (#36) AuthManager.extend() is an instance method accessed via the facade, not a static call. Updated docs and skill references to match.
…#33) Enables custom LoggerDriver registration via static extend() pattern (mirrors AuthManager.extend). Custom drivers checked before built-in switch in _resolveChannel(), config-driven resolution with override support. Includes resetDrivers() for test cleanup.
…cy (#36) AuthManager.extend() is an instance method accessed via the facade, not a static call. Updated docs and skill references to match.
5f9691e to
8b3d699
Compare
4 tasks
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.
Closes #33
Summary
LogManager.extend(name, factory)for customLoggerDriverregistration_resolveChannel()LogManager.resetDrivers()for test cleanup (static registry)extend()pattern asAuthManager.extend()Usage
Test plan
extend()registers custom driver factorydart analyze: zero warnings