Replace eprintln/println logging with tracing
Replace eprintln/println logging with tracing
#13 in tonybierman/dx-blog — merged 2026-05-29
What
Replaces all ad-hoc eprintln!/println! logging with tracing macros.
Why
The logging was inconsistent stderr/stdout print calls with manual [scope] LEVEL: text prefixes. tracing gives structured, level-filterable output that goes through the subscriber Dioxus already installs — no extra setup needed, since both dioxus::launch and dioxus::serve call dioxus_logger::initialize_default() (DEBUG in debug builds, INFO in release).
Changes
- Add
tracingas a direct dependency (already present transitively viadioxus-logger). eprintln!WARN/error calls →tracing::warn!/tracing::error!(server fns inserver/mod.rs,subscribers.rs,feeds.rs, and seed inmain.rs).println!startup/seed status lines →tracing::info!(main.rs,seed.rs).- The macro level +
target:now carry what the[scope] LEVEL:text prefix used to.
The only remaining println! is inside a seeded post's markdown body (sample content), which is intentional.
Verification
cargo fmtclean.- Type-checks both targets: server (
--features server,sqlite) and wasm (--features web --target wasm32-unknown-unknown).
🤖 Generated with Claude Code
Last updated 2026-05-30
Links to this note
Credits
Merged pull requests, newest first.