Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Log message API. More...
Data Structures | |
struct | log_msg_desc |
union | log_msg_source |
struct | log_msg_hdr |
struct | log_msg |
struct | log_msg_generic_hdr |
union | log_msg_generic |
Macros | |
#define | LOG_MSG_GENERIC_HDR |
#define | LOG_MSG_SIMPLE_ARG_CNT_CHECK(...) COND_CODE_1(UTIL_CAT(_LOG_MSG_SIMPLE_XXXX, NUM_VA_ARGS_LESS_1(__VA_ARGS__)), (1), (0)) |
#define | LOG_MSG_SIMPLE_ARG_TYPE_CHECK_0(fmt) 1 |
#define | LOG_MSG_SIMPLE_ARG_TYPE_CHECK_1(fmt, arg) Z_CBPRINTF_IS_WORD_NUM(arg) |
#define | LOG_MSG_SIMPLE_ARG_TYPE_CHECK_2(fmt, arg0, arg1) Z_CBPRINTF_IS_WORD_NUM(arg0) && Z_CBPRINTF_IS_WORD_NUM(arg1) |
#define | LOG_MSG_SIMPLE_ARG_TYPE_CHECK(...) UTIL_CAT(LOG_MSG_SIMPLE_ARG_TYPE_CHECK_, NUM_VA_ARGS_LESS_1(__VA_ARGS__))(__VA_ARGS__) |
brief Determine if string arguments types allow to use simplified message creation mode. | |
#define | LOG_MSG_SIMPLE_CHECK(...) |
Check if message can be handled using simplified method. | |
#define | LOG_MSG_SIMPLE_FUNC(_source, _level, ...) Z_LOG_MSG_SIMPLE_FUNC2(NUM_VA_ARGS_LESS_1(__VA_ARGS__), _source, _level, __VA_ARGS__) |
Call specific function to create a log message. | |
Functions | |
static uint32_t | log_msg_get_total_wlen (const struct log_msg_desc desc) |
Get total length (in 32 bit words) of a log message. | |
static uint32_t | log_msg_generic_get_wlen (const union mpsc_pbuf_generic *item) |
Get length of the log item. | |
static uint8_t | log_msg_get_domain (struct log_msg *msg) |
Get log message domain ID. | |
static uint8_t | log_msg_get_level (struct log_msg *msg) |
Get log message level. | |
static const void * | log_msg_get_source (struct log_msg *msg) |
Get message source data. | |
int16_t | log_msg_get_source_id (struct log_msg *msg) |
Get log message source ID. | |
static log_timestamp_t | log_msg_get_timestamp (struct log_msg *msg) |
Get timestamp. | |
static void * | log_msg_get_tid (struct log_msg *msg) |
Get Thread ID. | |
static uint8_t * | log_msg_get_data (struct log_msg *msg, size_t *len) |
Get data buffer. | |
static uint8_t * | log_msg_get_package (struct log_msg *msg, size_t *len) |
Get string package. | |
Log message API.
#define LOG_MSG_GENERIC_HDR |
#include <zephyr/logging/log_msg.h>
#define LOG_MSG_SIMPLE_ARG_CNT_CHECK | ( | ... | ) | COND_CODE_1(UTIL_CAT(_LOG_MSG_SIMPLE_XXXX, NUM_VA_ARGS_LESS_1(__VA_ARGS__)), (1), (0)) |
#include <zephyr/logging/log_msg.h>
#define LOG_MSG_SIMPLE_ARG_TYPE_CHECK | ( | ... | ) | UTIL_CAT(LOG_MSG_SIMPLE_ARG_TYPE_CHECK_, NUM_VA_ARGS_LESS_1(__VA_ARGS__))(__VA_ARGS__) |
#include <zephyr/logging/log_msg.h>
brief Determine if string arguments types allow to use simplified message creation mode.
... | String with arguments. |
#define LOG_MSG_SIMPLE_ARG_TYPE_CHECK_0 | ( | fmt | ) | 1 |
#include <zephyr/logging/log_msg.h>
#define LOG_MSG_SIMPLE_ARG_TYPE_CHECK_1 | ( | fmt, | |
arg | |||
) | Z_CBPRINTF_IS_WORD_NUM(arg) |
#include <zephyr/logging/log_msg.h>
#define LOG_MSG_SIMPLE_ARG_TYPE_CHECK_2 | ( | fmt, | |
arg0, | |||
arg1 | |||
) | Z_CBPRINTF_IS_WORD_NUM(arg0) && Z_CBPRINTF_IS_WORD_NUM(arg1) |
#include <zephyr/logging/log_msg.h>
#define LOG_MSG_SIMPLE_CHECK | ( | ... | ) |
#include <zephyr/logging/log_msg.h>
Check if message can be handled using simplified method.
Following conditions must be met:
... | String with arguments. |
1 | if message qualifies. |
0 | if message does not qualify. |
#define LOG_MSG_SIMPLE_FUNC | ( | _source, | |
_level, | |||
... | |||
) | Z_LOG_MSG_SIMPLE_FUNC2(NUM_VA_ARGS_LESS_1(__VA_ARGS__), _source, _level, __VA_ARGS__) |
#include <zephyr/logging/log_msg.h>
Call specific function to create a log message.
Macro picks matching function (based on number of arguments) and calls it. String arguments are casted to uint32_t.
_source | Source. |
_level | Severity level. |
... | String with arguments. |
|
inlinestatic |
#include <zephyr/logging/log_msg.h>
Get length of the log item.
item | Item. |
#include <zephyr/logging/log_msg.h>
Get data buffer.
msg | log message. |
len | location where data length is written. |
#include <zephyr/logging/log_msg.h>
Get log message domain ID.
msg | Log message. |
#include <zephyr/logging/log_msg.h>
Get log message level.
msg | Log message. |
#include <zephyr/logging/log_msg.h>
Get string package.
msg | log message. |
len | location where string package length is written. |
|
inlinestatic |
#include <zephyr/logging/log_msg.h>
Get message source data.
msg | Log message. |
#include <zephyr/logging/log_msg.h>
Get log message source ID.
msg | Log message. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <zephyr/logging/log_msg.h>
Get total length (in 32 bit words) of a log message.
desc | Log message descriptor. |