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 tracing as a direct dependency (already present transitively via dioxus-logger).
  • eprintln! WARN/error calls → tracing::warn! / tracing::error! (server fns in server/mod.rs, subscribers.rs, feeds.rs, and seed in main.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 fmt clean.
  • 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