mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 18:07:47 +00:00
[log] add build option OT_LOG_MAX_SIZE to set the max log string size (#10948)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user