diff --git a/src/cli/cli_config.h b/src/cli/cli_config.h index aea25066f..c263bfb82 100644 --- a/src/cli/cli_config.h +++ b/src/cli/cli_config.h @@ -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 * diff --git a/src/cli/cli_output.cpp b/src/cli/cli_output.cpp index aa4ebd33b..bdc6e9fbb 100644 --- a/src/cli/cli_output.cpp +++ b/src/cli/cli_output.cpp @@ -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