Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

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
 

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.
 
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_tlog_msg_get_data (struct log_msg *msg, size_t *len)
 Get data buffer.
 
static uint8_tlog_msg_get_package (struct log_msg *msg, size_t *len)
 Get string package.
 

Detailed Description

Log message API.

Macro Definition Documentation

◆ LOG_MSG_GENERIC_HDR

#define LOG_MSG_GENERIC_HDR

#include <zephyr/logging/log_msg.h>

Value:
uint32_t type:1
#define MPSC_PBUF_HDR
Header that must be added to the first word in each packet.
Definition: mpsc_packet.h:32
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90

Function Documentation

◆ log_msg_generic_get_wlen()

static uint32_t log_msg_generic_get_wlen ( const union mpsc_pbuf_generic item)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get length of the log item.

Parameters
itemItem.
Returns
Length in 32 bit words.

◆ log_msg_get_data()

static uint8_t * log_msg_get_data ( struct log_msg msg,
size_t len 
)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get data buffer.

Parameters
msglog message.
lenlocation where data length is written.
Returns
pointer to the data buffer.

◆ log_msg_get_domain()

static uint8_t log_msg_get_domain ( struct log_msg msg)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get log message domain ID.

Parameters
msgLog message.
Returns
Domain ID

◆ log_msg_get_level()

static uint8_t log_msg_get_level ( struct log_msg msg)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get log message level.

Parameters
msgLog message.
Returns
Log level.

◆ log_msg_get_package()

static uint8_t * log_msg_get_package ( struct log_msg msg,
size_t len 
)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get string package.

Parameters
msglog message.
lenlocation where string package length is written.
Returns
pointer to the package.

◆ log_msg_get_source()

static const void * log_msg_get_source ( struct log_msg msg)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get message source data.

Parameters
msgLog message.
Returns
Pointer to the source data.

◆ log_msg_get_tid()

static void * log_msg_get_tid ( struct log_msg msg)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get Thread ID.

Parameters
msgLog message.
Returns
Thread ID.

◆ log_msg_get_timestamp()

static log_timestamp_t log_msg_get_timestamp ( struct log_msg msg)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get timestamp.

Parameters
msgLog message.
Returns
Timestamp.

◆ log_msg_get_total_wlen()

static uint32_t log_msg_get_total_wlen ( const struct log_msg_desc  desc)
inlinestatic

#include <zephyr/logging/log_msg.h>

Get total length (in 32 bit words) of a log message.

Parameters
descLog message descriptor.
Returns
Length.