From a23ca75d9232a7ec62b985dac04ae09313ec1908 Mon Sep 17 00:00:00 2001 From: Holger Weber Date: Sat, 21 Feb 2026 15:46:28 +0100 Subject: [PATCH] Added timestamp to log output. --- src/Logging.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Logging.cpp b/src/Logging.cpp index faec960..e17a132 100644 --- a/src/Logging.cpp +++ b/src/Logging.cpp @@ -43,8 +43,13 @@ void appendJsonEscaped(String &out, const char *text) { } // namespace void Log(const String &message) { - const String trimmed = message.substring(0, kLogLineLength - 1); - trimmed.toCharArray(g_logLines[g_logWritePos], kLogLineLength); + snprintf( + g_logLines[g_logWritePos], + kLogLineLength, + "[%010lu] %s", + static_cast(millis()), + message.c_str() + ); g_logSeq[g_logWritePos] = g_nextLogSeq++; g_logWritePos = (g_logWritePos + 1) % kLogCapacity; }