shell: fix configuration issue

These checks should be against CONFIG_SHELL_LOG_BACKEND,
and not against CONFIG_LOG, since it's possible to enable
logging without building this particular backend.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-09-22 17:19:19 -07:00 committed by Anas Nashif
parent d6d3f152b3
commit a7787c8519
3 changed files with 5 additions and 5 deletions

View file

@ -64,7 +64,7 @@ int shell_log_backend_output_func(u8_t *data, size_t length, void *ctx);
*
* @param _name Shell name.
*/
#ifdef CONFIG_LOG
#ifdef CONFIG_SHELL_LOG_BACKEND
#define SHELL_LOG_BACKEND_DEFINE(_name, _buf, _size, _queue_size, _timeout) \
LOG_BACKEND_DEFINE(_name##_backend, log_backend_shell_api, false); \
K_MSGQ_DEFINE(_name##_msgq, sizeof(struct shell_log_backend_msg), \

View file

@ -150,8 +150,8 @@ config SHELL_CMDS_SELECT
config SHELL_LOG_BACKEND
bool
depends on !LOG_MINIMAL
default y if LOG
default n if !LOG
source "subsys/shell/modules/Kconfig"

View file

@ -1120,7 +1120,7 @@ static int instance_uninit(const struct shell *shell)
return -EBUSY;
}
if (IS_ENABLED(CONFIG_LOG)) {
if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) {
/* todo purge log queue */
shell_log_backend_disable(shell->log_backend);
}
@ -1174,7 +1174,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend,
return;
}
if (log_backend && IS_ENABLED(CONFIG_LOG)) {
if (log_backend && IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) {
shell_log_backend_enable(shell->log_backend, (void *)shell,
log_level);
}
@ -1204,7 +1204,7 @@ void shell_thread(void *shell_handle, void *arg_log_backend,
shell_signal_handle(shell, SHELL_SIGNAL_KILL, kill_handler);
shell_signal_handle(shell, SHELL_SIGNAL_RXRDY, shell_process);
if (IS_ENABLED(CONFIG_LOG)) {
if (IS_ENABLED(CONFIG_SHELL_LOG_BACKEND)) {
shell_signal_handle(shell, SHELL_SIGNAL_LOG_MSG,
shell_log_process);
}