Skip to content

feat: add opt-in structured logging - #253

Open
EliteCoder18 wants to merge 2 commits into
bitcoindevkit:masterfrom
EliteCoder18:feat/optional-tracing-logging
Open

feat: add opt-in structured logging#253
EliteCoder18 wants to merge 2 commits into
bitcoindevkit:masterfrom
EliteCoder18:feat/optional-tracing-logging

Conversation

@EliteCoder18

Copy link
Copy Markdown
Contributor

Description

Closes #246.

Adds an optional log feature backed by tracing.

When enabled, the client emits structured events for:

  • Client construction at DEBUG
  • HTTP requests and responses at TRACE
  • GET retry decisions and backoff duration at DEBUG
  • Both blocking and async clients

The events include the client mode, HTTP method, request path, attempt number, response status, and retry delay where applicable.

Base URLs, proxy values, headers, and request and response bodies are omitted. Request paths remain visible and may contain addresses or transaction IDs.

The tracing dependency remains optional. Its log compatibility allows applications using loggers such as env_logger to receive these events without configuring an additional bridge.

Adds tests covering structured event fields, request and retry lifecycles, sensitive-data omission, blocking and async clients, and log facade compatibility.

Notes to the reviewers

The tests are split by responsibility:

  • logging.rs verifies structured tracing events, request and retry lifecycles, and sensitive-data omission for blocking and async clients.
  • log_compat.rs verifies that the same events are available through the log facade for applications using loggers such as env_logger.

The minimum and recent lockfiles were updated for the optional tracing dependency.

Changelog notice

feat(log): add opt-in structured logging

@EliteCoder18
EliteCoder18 force-pushed the feat/optional-tracing-logging branch from 75e9597 to 97e5107 Compare September 5, 2026 16:47
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.

Implement logging

1 participant