Skip to content

Commit

Permalink
Adds tickcount to log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed Jun 9, 2022
1 parent 187d603 commit 47b2532
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/EFR32/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ extern "C" void efr32Log(const char * aFormat, ...)

va_start(v, aFormat);
#if EFR32_LOG_ENABLED
TickType_t now;
char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE];
static_assert(sizeof(formattedMsg) > kMaxCategoryStrLen); // Greater than to at least accommodate a ending Null Character

strcpy(formattedMsg, LOG_EFR32);
// strcat(formattedMsg, LOG_EFR32);
now = xTaskGetTickCount();
snprintf(formattedMsg, CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE, "[%ld] %s", now, LOG_EFR32);
size_t prefixLen = strlen(formattedMsg);
size_t len = vsnprintf(formattedMsg + prefixLen, sizeof formattedMsg - prefixLen, aFormat, v);

Expand Down

0 comments on commit 47b2532

Please sign in to comment.