[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:
Abtin Keshavarzian
2022-12-19 12:05:00 -08:00
committed by GitHub
parent 84308ca504
commit 81487725b0
2 changed files with 15 additions and 3 deletions
+12
View File
@@ -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
*
+3 -3
View File
@@ -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