From abf0601dc2b58c7c13b3fcb6d511818152453bdb Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Wed, 24 Jun 2026 05:52:14 +0800 Subject: [PATCH] feat(log): timestamp --verbose output + ScopedTimer for first-init steps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Diagnose first-run long hangs: every --verbose line now carries a wall-clock timestamp ([VERBOSE ]), and the one-time bootstrap steps (sandbox layout, patchelf, ninja) are wrapped in a ScopedTimer logging 'start' + 'done (Δ=ms)'. Logged to ~/.mcpp/log/mcpp.log always (already timestamped) + stderr under --verbose, so a slow step is attributable after the fact. Toolchain install already logs verbose (now timestamped). WS5 of the index/offline-first plan. --- src/log.cppm | 41 +++++++++++++++++++++++++++++++++++++++-- src/xlings.cppm | 4 ++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/log.cppm b/src/log.cppm index 6dbbcf10..7ee20714 100644 --- a/src/log.cppm +++ b/src/log.cppm @@ -43,6 +43,22 @@ void set_verbose(bool v); bool is_verbose(); void verbose(std::string_view tag, std::string_view message); +// Scoped verbose timer for diagnosing slow steps (e.g. first-run init / bootstrap +// hangs). Logs "