From 4dcf9da642047ce53bce0bddb7f039f64744b421 Mon Sep 17 00:00:00 2001 From: EnzinoBB Date: Tue, 27 Oct 2026 14:26:20 +0100 Subject: [PATCH 1/2] client: the snapshot commands start the logger with the configured levels --download-snapshot, --import-snapshot and --export-snapshot end before Peer sets the logger up, so Boost.Log's default sink printed every record the import makes to the console: 684,000 debug and trace lines for one --download-snapshot on Linux (the Docker first start included). They now call logger::initialize with the configuration's logger settings, as a running node does, and clean up at the end; the log of the import goes to log/ like the node's. Co-Authored-By: Claude Sonnet 5.5 --- client/src/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/client/src/main.cpp b/client/src/main.cpp index 6558f4fb2..7f65f8e03 100644 --- a/client/src/main.cpp +++ b/client/src/main.cpp @@ -221,12 +221,24 @@ int main(int argc, char* argv[]) { } } + // The snapshot commands end before Peer sets the logger up. Without it Boost.Log prints every + // record of the import, hundreds of thousands of debug and trace lines, to the console: the + // configured levels apply to them as to a running node. + const bool snapshotCommand = vm.count("download-snapshot") > 0 || vm.count("import-snapshot") > 0 || vm.count("export-snapshot") > 0; + if (snapshotCommand) { + logger::initialize(config.getLoggerSettings()); + } + auto finishCommand = [](int code) { + logger::cleanup(); + return code; + }; + // no keys needed: the import writes only the database, the caches and the checkpoint if (vm.count("download-snapshot") > 0) { - return snapshot_export::runDownload(config, vm["download-snapshot"].as()); + return finishCommand(snapshot_export::runDownload(config, vm["download-snapshot"].as())); } if (vm.count("import-snapshot") > 0) { - return snapshot_export::runImport(config, vm["import-snapshot"].as()); + return finishCommand(snapshot_export::runImport(config, vm["import-snapshot"].as())); } if (vm.count(cmdline::argSeed) == 0) { @@ -241,7 +253,7 @@ int main(int argc, char* argv[]) { } if (vm.count("export-snapshot") > 0) { - return snapshot_export::run(config, vm["export-snapshot"].as()); + return finishCommand(snapshot_export::run(config, vm["export-snapshot"].as())); } if (vm.count(cmdline::argDumpKeys) > 0) { From 067a474b37bd467a0f4b0b95668d8127486bc608 Mon Sep 17 00:00:00 2001 From: EnzinoBB Date: Tue, 27 Oct 2026 15:13:38 +0100 Subject: [PATCH 2/2] docs: CHANGES line for the CLI log fix Co-Authored-By: Claude Sonnet 5.5 --- docs/CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 574195948..9ebd4eba1 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -41,6 +41,7 @@ lines under the new release. | #114 | the node builds and passes its tests on Windows (MSVC, x64) and macOS (Apple Silicon): POSIX-only code behind `lib/system/platform.hpp`, the database lock now also on Windows, a new `build-platforms.yml` workflow; the release workflow also makes a Windows `.zip` and a macOS package (with Eclipse Temurin 11), kept as artifacts until a mainnet state-digest check on each system | | #115 | Windows and macOS nodes load the checkpoints and snapshots of Linux and sync mainnet with the same state digests: the binary checkpoint header records `long` as 8 bytes on every system (`cs::ArchiveOutput`, read back by `cs::ArchiveInput`), checkpoint text files are read and written in binary mode, macOS Boost is built as C++17; `Transport` releases the routing table with the p2p host, fixing a use-after-free at exit (a crash on macOS); a platform consensus check in CI | | #116 | snapshot: `node --survey-snapshots [seconds]` asks the neighbours for the snapshots they serve without opening the chain and prints what they declared; the weekly known-hosts job turns it into `snapshots.md` and `snapshot_sources.txt` (shipped in the packages when present) | +| #117 | client: `--download-snapshot`, `--import-snapshot` and `--export-snapshot` start the logger with the configured levels; they printed every debug and trace record of the import to the console (about 684,000 lines for one `--download-snapshot`, the Docker first start included) | ## community.13 — 2026-10-26