logging: better use of log::Entry internally #34865

pull stickies-v wants to merge 4 commits into bitcoin:master from stickies-v:2026-03/logging-use-entry changing 4 files +58 −55
  1. stickies-v commented at 12:47 pm on March 19, 2026: contributor

    Preparatory work to enable struct-based logging for kernel (#34374), but I think it’s a mild improvement by itself too.

    #34465 introduced util::log::Entry. This PR updates some internal functions and structs to make better use of that new plumbing.

    Mostly a refactor, although ddfc66071a86bedc4b81096174e39df0b116e1d2 can very slightly affect the log’s timestamp.

  2. DrahtBot commented at 12:47 pm on March 19, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34806 (refactor: logging: Various API improvements by ajtowns)
    • #34730 (util/log: Combine the warning/error log levels into a single alert level by ajtowns)
    • #34514 (refactor: remove unnecessary std::move for trivially copyable types by l0rinc)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Needs rebase on Mar 24, 2026
  4. util: add timestamp and thread_name to log::Entry d6cf7ff1b1
  5. logging: pass log::Entry through to logging functions
    Use the entry's timestamp and thread_name, captured at the call
    site, instead of re-capturing them in the logger.
    05a89da0d4
  6. logging: make BufferedLog a log::Entry wrapper ebb0a14ace
  7. logging: replace FormatLogStrInPlace with Format
    Return a new string built left-to-right instead of mutating one
    with repeated insert(0, ...). Take a const log::Entry ref since
    both call sites now have an Entry available. Also move
    LogEscapeMessage inside so callers don't need to pre-escape.
    b94475aecd
  8. stickies-v force-pushed on Mar 24, 2026
  9. DrahtBot removed the label Needs rebase on Mar 24, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-31 12:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me