refactor(dash-spv): make logging a built-in event handler#745
refactor(dash-spv): make logging a built-in event handler#745xdustinface wants to merge 1 commit intov0.42-devfrom
Conversation
Move `LoggingEventHandler` out of the CLI binary and into `dash-spv` itself, then have `DashSpvClient::new` prepend it to the consumer-supplied handler list. Every consumer (CLI, FFI, integration tests, future embedders) now gets event log output for free as soon as a `tracing` subscriber is installed, instead of each one re-implementing the same bridge. The handler is `pub(crate)` since consumers never need to construct or reference it. Per-event silencing is available through the standard `tracing` target filter `dash_spv::client::event_handler=warn`, so no opt-out flag is needed.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughLoggingEventHandler is introduced as a built-in, crate-private handler in the event_handler module and automatically injected into every DashSpvClient during construction. The CLI removes its own redundant logging handler implementation and relies on this built-in instead, simplifying main.rs. A test verifies single handler auto-attachment. ChangesBuilt-in Logging Handler Integration
🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.42-dev #745 +/- ##
=============================================
+ Coverage 71.31% 71.63% +0.31%
=============================================
Files 321 321
Lines 70339 70359 +20
=============================================
+ Hits 50160 50399 +239
+ Misses 20179 19960 -219
|
Move
LoggingEventHandlerout of the CLI binary and intodash-spvitself, then haveDashSpvClient::newprepend it to the consumer-supplied handler list. Every consumer (CLI, FFI, integration tests, future embedders) now gets event log output for free as soon as atracingsubscriber is installed, instead of each one re-implementing the same bridge.The handler is
pub(crate)since consumers never need to construct or reference it. Per-event silencing is available through the standardtracingtarget filterdash_spv::client::event_handler=warn, so no opt-out flag is needed.Summary by CodeRabbit
Refactor
Tests