[log] add build option OT_LOG_MAX_SIZE to set the max log string size (#10948)

This commit is contained in:
Zhanglong Xia
2024-11-20 20:06:35 -08:00
committed by GitHub
parent d5d602267c
commit 7f6723ffb3
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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);
+2 -1
View File
@@ -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
/**