logging: added log process thread priority support

Added Zephyr config items to support setting the priority of the log
process thread at build time.

Signed-off-by: Justin Huang <justinyhuang@fb.com>
This commit is contained in:
Justin Huang 2022-07-11 15:32:22 -10:00 committed by Christopher Friedt
commit cb5264162d
2 changed files with 20 additions and 1 deletions

View file

@ -42,6 +42,12 @@ LOG_MODULE_REGISTER(log);
#define CONFIG_LOG_BUFFER_SIZE 4
#endif
#ifdef CONFIG_LOG_PROCESS_THREAD_CUSTOM_PRIORITY
#define LOG_PROCESS_THREAD_PRIORITY CONFIG_LOG_PROCESS_THREAD_PRIORITY
#else
#define LOG_PROCESS_THREAD_PRIORITY K_LOWEST_APPLICATION_THREAD_PRIO
#endif
#ifndef CONFIG_LOG_TAG_MAX_LEN
#define CONFIG_LOG_TAG_MAX_LEN 0
#endif
@ -693,7 +699,7 @@ static int enable_logger(const struct device *arg)
k_thread_create(&logging_thread, logging_stack,
K_KERNEL_STACK_SIZEOF(logging_stack),
log_process_thread_func, NULL, NULL, NULL,
K_LOWEST_APPLICATION_THREAD_PRIO, 0,
LOG_PROCESS_THREAD_PRIORITY, 0,
COND_CODE_1(CONFIG_LOG_PROCESS_THREAD,
K_MSEC(CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS),
K_NO_WAIT));