1 /* 2 * Copyright (c) 2018 Runtime Inc 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __MCUBOOT_LOGGING_H__ 8 #define __MCUBOOT_LOGGING_H__ 9 10 /* 11 * When building for targets running Zephyr, delegate to its native 12 * logging subsystem. 13 */ 14 #ifdef CONFIG_MCUBOOT 15 #define MCUBOOT_LOG_MODULE_DECLARE(domain) LOG_MODULE_DECLARE(domain, CONFIG_MCUBOOT_LOG_LEVEL) 16 #define MCUBOOT_LOG_MODULE_REGISTER(domain) LOG_MODULE_REGISTER(domain, CONFIG_MCUBOOT_LOG_LEVEL) 17 #else 18 #define MCUBOOT_LOG_MODULE_DECLARE(domain) LOG_MODULE_DECLARE(domain, CONFIG_MCUBOOT_UTIL_LOG_LEVEL) 19 #define MCUBOOT_LOG_MODULE_REGISTER(domain) LOG_MODULE_REGISTER(domain, CONFIG_MCUBOOT_UTIL_LOG_LEVEL) 20 #endif 21 22 #define MCUBOOT_LOG_ERR(...) LOG_ERR(__VA_ARGS__) 23 #define MCUBOOT_LOG_WRN(...) LOG_WRN(__VA_ARGS__) 24 #define MCUBOOT_LOG_INF(...) LOG_INF(__VA_ARGS__) 25 #define MCUBOOT_LOG_DBG(...) LOG_DBG(__VA_ARGS__) 26 #define MCUBOOT_LOG_SIM(...) IGNORE(__VA_ARGS__) 27 28 #include <zephyr/logging/log.h> 29 30 #endif /* __MCUBOOT_LOGGING_H__ */ 31