diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index 06d8e31dc..913c68161 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -333,6 +333,7 @@ ot_string_option(OT_VENDOR_SW_VERSION OPENTHREAD_CONFIG_NET_DIAG_VENDOR_SW_VERSI set(OT_POWER_SUPPLY_VALUES "BATTERY" "EXTERNAL" "EXTERNAL_STABLE" "EXTERNAL_UNSTABLE") ot_multi_option(OT_POWER_SUPPLY OT_POWER_SUPPLY_VALUES OPENTHREAD_CONFIG_DEVICE_POWER_SUPPLY OT_POWER_SUPPLY_ "set the device power supply config") +ot_int_option(OT_LOG_MAX_SIZE OPENTHREAD_CONFIG_LOG_MAX_SIZE "set maximum log string size") ot_int_option(OT_MAC_CSL_REQUEST_AHEAD_US OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US "set time ahead to deliver CSL frame from MAC to SubMac in microseconds") ot_int_option(OT_MLE_MAX_CHILDREN OPENTHREAD_CONFIG_MLE_MAX_CHILDREN "set maximum number of children") ot_int_option(OT_RCP_RESTORATION_MAX_COUNT OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT "set max RCP restoration count") diff --git a/examples/platforms/simulation/logging.c b/examples/platforms/simulation/logging.c index cce2ad558..8ac767771 100644 --- a/examples/platforms/simulation/logging.c +++ b/examples/platforms/simulation/logging.c @@ -101,7 +101,7 @@ void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat if (sLogFile == NULL) { - char logString[512]; + char logString[12 /* NodeId */ + OPENTHREAD_CONFIG_LOG_MAX_SIZE]; int offset; offset = snprintf(logString, sizeof(logString), "[%lu]", (unsigned long)gNodeId); diff --git a/examples/platforms/utils/logging_rtt.h b/examples/platforms/utils/logging_rtt.h index 663fd068b..98d006bfa 100644 --- a/examples/platforms/utils/logging_rtt.h +++ b/examples/platforms/utils/logging_rtt.h @@ -93,7 +93,8 @@ extern "C" { * stack. */ #ifndef LOG_PARSE_BUFFER_SIZE -#define LOG_PARSE_BUFFER_SIZE 128 +#define LOG_PARSE_BUFFER_SIZE \ + (19 /* Timestamp */ + 8 /* RTT color code */ + OPENTHREAD_CONFIG_LOG_MAX_SIZE + 1 /* \n */) #endif /**