Skip to content

feat!: require --enable-logging flag to install tracing subscriber#65

Open
mickvandijke wants to merge 1 commit intorc-2026.4.1from
feat/logging-flag
Open

feat!: require --enable-logging flag to install tracing subscriber#65
mickvandijke wants to merge 1 commit intorc-2026.4.1from
feat/logging-flag

Conversation

@mickvandijke
Copy link
Copy Markdown
Collaborator

Summary

  • Adds an explicit --enable-logging flag (env: ANT_ENABLE_LOGGING) to both ant-node and ant-devnet. Without it, the tracing subscriber is never installed and no log records are emitted, even when the binary is built with the logging feature.
  • The remaining --log-level / --log-format / --log-dir / --log-max-files options are ignored unless --enable-logging is set.
  • Hoists the tracing_subscriber use statements in ant-node/main.rs to file scope per the project's "imports at module level only" rule.

Why

Previously, default builds (which include the logging feature) auto-installed a stdout subscriber, so any invocation of ant-node printed logs whether the operator wanted them or not. Logging output should be opt-in at runtime, not just at build time.

BREAKING CHANGE

Default builds no longer log to stdout automatically. Operators that relied on implicit logging must now pass --enable-logging (or set ANT_ENABLE_LOGGING=1).

Test plan

  • cargo build --bin ant-node --bin ant-devnet (default features)
  • cargo build --bin ant-node --bin ant-devnet --no-default-features
  • cargo clippy --bins --all-features -- -D warnings
  • cargo fmt --all -- --check
  • Smoke test: ./ant-node --rewards-address 0x0… produces 0 lines of output
  • Smoke test: ./ant-node --enable-logging --rewards-address 0x0… produces normal tracing output
  • CI green

🤖 Generated with Claude Code

Even with the `logging` feature compiled in (the default), the tracing
subscriber is now only installed when the user passes `--enable-logging`
(or sets `ANT_ENABLE_LOGGING=1`). Without the flag, ant-node and
ant-devnet emit zero log output. The remaining `--log-*` options are
ignored unless the flag is set.

BREAKING CHANGE: Default builds no longer log to stdout automatically.
Operators that relied on implicit logging must now pass
`--enable-logging` (or set `ANT_ENABLE_LOGGING=1`).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 8, 2026 17:58
@mickvandijke mickvandijke changed the base branch from main to rc-2026.4.1 April 8, 2026 17:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants