mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 16:09:51 +00:00
[cli] add config for log level for emitting cli input/output to logs (#8545)
This commit adds `OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL` to specify the log level to use when CLI input/output is emitted to logs (`OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE` is enabled).
This commit is contained in:
@@ -101,6 +101,18 @@
|
||||
(OPENTHREAD_POSIX && (OPENTHREAD_CONFIG_LOG_OUTPUT != OPENTHREAD_CONFIG_LOG_OUTPUT_APP))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL
|
||||
*
|
||||
* Defines the log level to use when CLI emits its command input/output to the logs.
|
||||
*
|
||||
* This is used only when `OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE` is enabled.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL
|
||||
#define OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL OT_LOG_LEVEL_DEBG
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LOG_STRING_SIZE
|
||||
*
|
||||
|
||||
@@ -307,7 +307,7 @@ void OutputImplementer::OutputV(const char *aFormat, va_list aArguments)
|
||||
|
||||
if (lineEnd > mOutputString)
|
||||
{
|
||||
otLogCli(OT_LOG_LEVEL_DEBG, "Output: %s", mOutputString);
|
||||
otLogCli(OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL, "Output: %s", mOutputString);
|
||||
}
|
||||
|
||||
lineEnd++;
|
||||
@@ -348,7 +348,7 @@ void OutputImplementer::OutputV(const char *aFormat, va_list aArguments)
|
||||
|
||||
if (truncated)
|
||||
{
|
||||
otLogCli(OT_LOG_LEVEL_DEBG, "Output: %s ...", mOutputString);
|
||||
otLogCli(OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL, "Output: %s ...", mOutputString);
|
||||
mOutputLength = 0;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ void Output::LogInput(const Arg *aArgs)
|
||||
inputString.Append(isFirst ? "%s" : " %s", aArgs->GetCString());
|
||||
}
|
||||
|
||||
otLogCli(OT_LOG_LEVEL_DEBG, "Input: %s", inputString.AsCString());
|
||||
otLogCli(OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_LEVEL, "Input: %s", inputString.AsCString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user