From 90e1183868d059ea6d359d4b5da3013fc9a6a52c Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 9 Dec 2024 10:45:44 +0100 Subject: [PATCH] [darwin-framework-tool] Print the queue name (or a shorter version for common queues) when logging --- examples/darwin-framework-tool/logging/logging.mm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/darwin-framework-tool/logging/logging.mm b/examples/darwin-framework-tool/logging/logging.mm index a596ee0eae2a9c..2a3469649f69c5 100644 --- a/examples/darwin-framework-tool/logging/logging.mm +++ b/examples/darwin-framework-tool/logging/logging.mm @@ -23,6 +23,7 @@ #include #include #include +#include #include namespace dft { @@ -56,9 +57,17 @@ void LogMessage(MTRLogType type, NSString * component, NSString * message) int pid = [[NSProcessInfo processInfo] processIdentifier]; auto tid = pthread_mach_thread_np(pthread_self()); - - fprintf(stdout, "%s%s [%d:%u] [%s]: %s%s\n", loggingColor.UTF8String, formattedDate.UTF8String, pid, tid, - component.UTF8String, message.UTF8String, kLoggingColorEnd.UTF8String); + const char * label = chip::darwin::queues::CurrentLabel(); + + fprintf(stdout, "%s%s [%d:%u:%s] [%s]: %s%s\n", + loggingColor.UTF8String, + formattedDate.UTF8String, + pid, + tid, + label, + component.UTF8String, + message.UTF8String, + kLoggingColorEnd.UTF8String); } void LogRedirectCallback(const char * moduleName, uint8_t category, const char * format, va_list args)