From 702e67078a96a15fb0a7076b017706c74d7b0280 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Sat, 19 Jun 2021 01:44:14 +0200 Subject: [PATCH] Add running core to Log --- src/hasp_debug.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 699a02fc..dace63c1 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -66,9 +66,10 @@ static void debugPrintTimestamp(int level, Print* _logOutput) unsigned long int milli = curTime.tv_usec / 1000; char buffer[24]; // strftime(buffer, sizeof(buffer), "[%b %d %H:%M:%S", timeinfo); // Literal String - strftime(buffer, sizeof(buffer), "[" D_TIMESTAMP, timeinfo); // Literal String + strftime(buffer, sizeof(buffer), " [" D_TIMESTAMP, timeinfo); // Literal String #ifdef ARDUINO + _logOutput->print(xPortGetCoreID()); _logOutput->printf(PSTR("%s.%03lu]"), buffer, milli); #else debug_print(_logOutput, PSTR("%s.%03lu]"), buffer, milli); @@ -78,7 +79,8 @@ static void debugPrintTimestamp(int level, Print* _logOutput) uint32_t msecs = millis(); #ifdef ARDUINO - _logOutput->printf(PSTR("[" D_TIME_MILLIS ".%03d]"), msecs / 1000, msecs % 1000); + _logOutput->print(xPortGetCoreID()); + _logOutput->printf(PSTR(" [" D_TIME_MILLIS ".%03d]"), msecs / 1000, msecs % 1000); #else debug_print(_logOutput, PSTR("[" D_TIME_MILLIS ".%03d]"), msecs / 1000, msecs % 1000); #endif