Skip to content

Commit f394973

Browse files
committed
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 <[email protected]>
1 parent 65266bd commit f394973

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/logging/log.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ extern "C" {
7070
*/
7171
#define LOG_DBG(...) Z_LOG(LOG_LEVEL_DBG, __VA_ARGS__)
7272

73+
/**
74+
* @brief Unconditionally print raw log message.
75+
*
76+
* The result is same as if printk was used but it goes through logging
77+
* infrastructure thus utilizes logging mode, e.g. deferred mode.
78+
*
79+
* @param ... A string optionally containing printk valid conversion specifier,
80+
* followed by as many values as specifiers.
81+
*/
82+
#define LOG_PRINTK(...) Z_LOG_PRINTK(__VA_ARGS__)
83+
7384
/**
7485
* @brief Writes an ERROR level message associated with the instance to the log.
7586
*

0 commit comments

Comments
 (0)