Skip to content

Commit 74ceae5

Browse files
mike-scottnvlsianpu
authored andcommitted
boot: zephyr: establish an MCUBOOT_LOG_LEVEL config
Rather than use LOG_DEFAULT_LEVEL to control MCUBOOT's log output, let's create an MCUBOOT specific log level setting. Signed-off-by: Michael Scott <[email protected]> Signed-off-by: Andrzej Puzdrowski <[email protected]> Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent cef4427 commit 74ceae5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

boot/zephyr/Kconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,16 @@ config BOOT_HAVE_LOGGING
140140
select LOG_IMMEDIATE
141141
help
142142
If y, enables logging on the serial port. The log level can
143-
be defined by setting `LOG_DEFAULT_LEVEL`.
143+
be defined by setting `CONFIG_MCUBOOT_LOG_LEVEL_*`.
144144
If unsure, leave at the default value.
145145

146+
if BOOT_HAVE_LOGGING
147+
module = MCUBOOT
148+
module-dep = LOG
149+
module-str = Log level for MCUBOOT application
150+
source "subsys/logging/Kconfig.template.log_config"
151+
endif
152+
146153
menuconfig MCUBOOT_SERIAL
147154
bool "MCUboot serial recovery"
148155
default n

boot/zephyr/include/mcuboot_config/mcuboot_logging.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* logging subsystem.
1515
*/
1616

17-
#define MCUBOOT_LOG_MODULE_DECLARE(domain) LOG_MODULE_DECLARE(domain)
18-
#define MCUBOOT_LOG_MODULE_REGISTER(domain) LOG_MODULE_REGISTER(domain)
17+
#define MCUBOOT_LOG_MODULE_DECLARE(domain) LOG_MODULE_DECLARE(domain, CONFIG_MCUBOOT_LOG_LEVEL)
18+
#define MCUBOOT_LOG_MODULE_REGISTER(domain) LOG_MODULE_REGISTER(domain, CONFIG_MCUBOOT_LOG_LEVEL)
1919

2020
#define MCUBOOT_LOG_ERR(...) LOG_ERR(__VA_ARGS__)
2121
#define MCUBOOT_LOG_WRN(...) LOG_WRN(__VA_ARGS__)

0 commit comments

Comments
 (0)