Change Description
This is a deliberately small first step for structured logging: add an optional fields vector to util::log::Entry and a small util::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:
- adds
util::log::KeyValueandutil::log::KV(); - stores
std::vector<KeyValue> fieldsonutil::log::Entry; - accounts for field memory usage while entries are buffered before logging starts;
- extends a logging unit test to pass fields and confirm legacy formatted output remains unchanged.
This addresses the consumer-side foundation discussed in #35369.
Testing
git diff --check- Attempted CMake configure with
cmake -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.