From 1675d49b4cba95a529b1126d74723a3220ee3c7e Mon Sep 17 00:00:00 2001 From: Ian Oliver Date: Tue, 6 Dec 2022 15:31:46 -0800 Subject: [PATCH] log_core: Add Kconfig symbol for init priority Users may want to do some configuration after the kernel is up, but before initializing the log_core. Making the log_core's init priority configurable makes that possible. Signed-off-by: Ian Oliver --- subsys/logging/Kconfig | 5 +++++ subsys/logging/log_core.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/subsys/logging/Kconfig b/subsys/logging/Kconfig index 83020b388f6..57e447f85a0 100644 --- a/subsys/logging/Kconfig +++ b/subsys/logging/Kconfig @@ -12,6 +12,11 @@ config LOG if LOG +config LOG_CORE_INIT_PRIORITY + int "Log Core Initialization Priority" + range 0 99 + default 0 + rsource "Kconfig.mode" rsource "Kconfig.filtering" diff --git a/subsys/logging/log_core.c b/subsys/logging/log_core.c index 63da3896bd2..8e009808201 100644 --- a/subsys/logging/log_core.c +++ b/subsys/logging/log_core.c @@ -907,4 +907,4 @@ static int enable_logger(const struct device *arg) return 0; } -SYS_INIT(enable_logger, POST_KERNEL, 0); +SYS_INIT(enable_logger, POST_KERNEL, CONFIG_LOG_CORE_INIT_PRIORITY);