Skip to content

Remove old env_logger and log dependencies - #336

Closed
emma31-dev wants to merge 3 commits into
bitcoindevkit:masterfrom
emma31-dev:delete/old-env_logger-dependency
Closed

emma31-dev wants to merge 3 commits into
bitcoindevkit:masterfrom
emma31-dev:delete/old-env_logger-dependency

Conversation

@emma31-dev

Copy link
Copy Markdown

Description

BDK-CLI has had env_logger for over 4 years and it served the project well but in recent time tracing came along because of payjoin and in is now used in many other areas of the codebase. env_logger with log is only used in main.rs and config.rs for just a single log. yet the package itself adds to binary size with little use now tracing handles the logs better.

Changelog notice

  • Dropped env-logger and log dependencies

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Replace log calls with tracing equivalents.

Signed-off-by: emma31-dev <emmanuelfidel07@gmail.com>
Signed-off-by: emma31-dev <emmanuelfidel07@gmail.com>
Signed-off-by: emma31-dev <emmanuelfidel07@gmail.com>
@vadim-anfv

Copy link
Copy Markdown
Collaborator

Concept NACK: this removes logging entirely.

env_logger::init() in main.rs is the only place a subscriber is installed for normal runs, and nothing takes its place, so nothing is printed any more, except on the cbf path, which installs its own subscriber in src/client.rs.

The branch also does not compile: src/handlers/dns/mod.rs:93 still calls log::info!, so cargo build --all-features fails once the dependency is gone.

The PR does point at a real problem though. Even on master nothing is logged unless RUST_LOG is set, because env_logger defaults to the error level, so the mainnet warning never reaches the user:

$ bdk-cli --network=bitcoin wallets
Error: Generic error: No wallets configured yet.

$ RUST_LOG=info bdk-cli --network=bitcoin wallets
[2026-10-14T11:23:11Z WARN  bdk_cli] This is experimental software and not currently recommended for use on Bitcoin mainnet, proceed with caution.
Error: Generic error: No wallets configured yet.

Thanks for raising the topic!

@vadim-anfv vadim-anfv closed this Oct 14, 2026
@emma31-dev

Copy link
Copy Markdown
Author

Thank you for the detailed feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants