log: add structured fields to log entries#35376
Closed
0xjc65eth wants to merge 1 commit into
Closed
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35376. ReviewsSee the guideline for information on the review process. |
Contributor
|
NACK We don't accept PRs where it is not clear that the author understands the changes. Since the PR description even includes the error output from an LLM that is doubtful. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
This is a deliberately small first step for structured logging: add an optional
fieldsvector toutil::log::Entryand a smallutil::log::KV()helper for producers.The existing text output is intentionally unchanged in this PR. The change gives future JSON/ZMQ/database log consumers a place to read structured per-message data without forcing a decision about the final wire format in the first patch.
Concretely this PR:
util::log::KeyValueandutil::log::KV();std::vector<KeyValue> fieldsonutil::log::Entry;This addresses the consumer-side foundation discussed in #35369.
Testing
git diff --checkcmake -B build -S . -DBUILD_GUI=OFF -DBUILD_BENCH=OFF -DBUILD_FUZZ_BINARY=OFF -DWITH_ZMQ=OFF -DWITH_USDT=OFF -DWITH_MULTIPROCESS=OFF; configure stopped because Boost >= 1.74 is not installed in this local environment.The message stays human; the fields wait beneath it.