Skip to content

Misc logging improvements for easier test debugging - #916

Closed
nothingmuch wants to merge 3 commits into
payjoin:masterfrom
nothingmuch:misc-logging-changes
Closed

nothingmuch wants to merge 3 commits into
payjoin:masterfrom
nothingmuch:misc-logging-changes

Conversation

@nothingmuch

Copy link
Copy Markdown
Contributor

cc @0xZaddyy, since you wanted to work on logging related changes, here are a few commits i found useful while testing for your consideration

note that this is incomplete, but does demonstrate some of the benefits to focusing on the tracing crate if we really want to switch to the tracing crate throughout (i am in favor)

IMO payjoin crate can have a tracing feature that just imports tracing::${foo} if enabled or log::${foo} if disabled in case people want to opt out of using the tracing crate, this is a bit nicer than shoehorning the stdlog subscriber into the tracing crate (#584)

see also #509

@0xZaddyy

0xZaddyy commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

IMO payjoin crate can have a tracing feature that just imports tracing::${foo} if enabled or log::${foo} if disabled in case people want to opt out of using the tracing crate, this is a bit nicer than shoehorning the stdlog subscriber into the tracing crate (#584)

I agree that a feature‑gated approach for tracing makes sense.
making tracing optional, that way existing log users can continue with it.
i think when we run the right Cargo feature flag, we can compile‑time switch between tracing::{debug, info, warn, error} and log::{debug, info, warn, error}, which feels cleaner and easier.

@0xZaddyy

0xZaddyy commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

cc @0xZaddyy, since you wanted to work on logging related changes, here are a few commits i found useful while testing for your consideration

Thank you for sharing this :)
I’ll review and keep them in mind as I work on the logging changes.

@coveralls

coveralls commented Aug 4, 2025 •

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 17332637468

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 85.916%

Totals Coverage Status
Change from base Build 17332008623: 0.0%
Covered Lines: 8168
Relevant Lines: 9507

💛 - Coveralls

@arminsabouri arminsabouri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ConceptACK

@nothingmuch
nothingmuch force-pushed the misc-logging-changes branch from 6f76663 to 1e6282a Compare August 29, 2025 19:31
@nothingmuch

Copy link
Copy Markdown
Contributor Author

updated post #1020 merge, these changes should probably be incorporated into #950 to minimize conflicts

with tracing in use, i think we can also be more mindful of log spans, and enabling tracing-chrome output collection in CI (the trace would be an artifact that can be downloaded and viewed in any chromium based browser), and/or consider using test-log crate instead of our custom tracing initialization

@nothingmuch

Copy link
Copy Markdown
Contributor Author

largely superseded by #911

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.

4 participants