From 963d60cec5b3050585600a0d3f547d0be1d69fbb Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Thu, 4 Feb 2021 13:50:16 +0100 Subject: [PATCH] logging: Add LOG_PRINTK macro for printing via logging Added macro which allows to print formatted string using logging infrastructure. Signed-off-by: Krzysztof Chruscinski --- include/logging/log.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/logging/log.h b/include/logging/log.h index 4992308c0b7..31c22e1a8a6 100644 --- a/include/logging/log.h +++ b/include/logging/log.h @@ -70,6 +70,17 @@ extern "C" { */ #define LOG_DBG(...) Z_LOG(LOG_LEVEL_DBG, __VA_ARGS__) +/** + * @brief Unconditionally print raw log message. + * + * The result is same as if printk was used but it goes through logging + * infrastructure thus utilizes logging mode, e.g. deferred mode. + * + * @param ... A string optionally containing printk valid conversion specifier, + * followed by as many values as specifiers. + */ +#define LOG_PRINTK(...) Z_LOG_PRINTK(__VA_ARGS__) + /** * @brief Writes an ERROR level message associated with the instance to the log. *