Zephyr API 3.6.99
|
Log output API . More...
Topics | |
Log output formatting flags. | |
Data Structures | |
struct | log_output_control_block |
struct | log_output |
Log_output instance structure. More... | |
Macros | |
#define | LOG_OUTPUT_TEXT 0 |
Supported backend logging format types for use with log_format_set() API to switch log format at runtime. | |
#define | LOG_OUTPUT_SYST 1 |
#define | LOG_OUTPUT_DICT 2 |
#define | LOG_OUTPUT_CUSTOM 3 |
#define | LOG_OUTPUT_DEFINE(_name, _func, _buf, _size) |
Create log_output instance. | |
Typedefs | |
typedef int(* | log_output_func_t) (uint8_t *buf, size_t size, void *ctx) |
Prototype of the function processing output data. | |
typedef void(* | log_format_func_t) (const struct log_output *output, struct log_msg *msg, uint32_t flags) |
Typedef of the function pointer table "format_table". | |
Functions | |
log_format_func_t | log_format_func_t_get (uint32_t log_type) |
Declaration of the get routine for function pointer table format_table. | |
void | log_output_msg_process (const struct log_output *log_output, struct log_msg *msg, uint32_t flags) |
Process log messages v2 to readable strings. | |
void | log_output_process (const struct log_output *log_output, log_timestamp_t timestamp, const char *domain, const char *source, k_tid_t tid, uint8_t level, const uint8_t *package, const uint8_t *data, size_t data_len, uint32_t flags) |
Process input data to a readable string. | |
void | log_output_msg_syst_process (const struct log_output *log_output, struct log_msg *msg, uint32_t flags) |
Process log messages v2 to SYS-T format. | |
void | log_output_dropped_process (const struct log_output *output, uint32_t cnt) |
Process dropped messages indication. | |
static void | log_output_write (log_output_func_t outf, uint8_t *buf, size_t len, void *ctx) |
Write to the output buffer. | |
static void | log_output_flush (const struct log_output *output) |
Flush output buffer. | |
static void | log_output_ctx_set (const struct log_output *output, void *ctx) |
Function for setting user context passed to the output function. | |
static void | log_output_hostname_set (const struct log_output *output, const char *hostname) |
Function for setting hostname of this device. | |
void | log_output_timestamp_freq_set (uint32_t freq) |
Set timestamp frequency. | |
uint64_t | log_output_timestamp_to_us (log_timestamp_t timestamp) |
Convert timestamp of the message to us. | |
void | log_custom_output_msg_process (const struct log_output *log_output, struct log_msg *msg, uint32_t flags) |
Custom logging output formatting. | |
Log output API .
#define LOG_OUTPUT_CUSTOM 3 |
#include <zephyr/logging/log_output.h>
#define LOG_OUTPUT_DEFINE | ( | _name, | |
_func, | |||
_buf, | |||
_size ) |
#include <zephyr/logging/log_output.h>
Create log_output instance.
_name | Instance name. |
_func | Function for processing output data. |
_buf | Pointer to the output buffer. |
_size | Size of the output buffer. |
#define LOG_OUTPUT_DICT 2 |
#include <zephyr/logging/log_output.h>
#define LOG_OUTPUT_SYST 1 |
#include <zephyr/logging/log_output.h>
#define LOG_OUTPUT_TEXT 0 |
#include <zephyr/logging/log_output.h>
Supported backend logging format types for use with log_format_set() API to switch log format at runtime.
typedef void(* log_format_func_t) (const struct log_output *output, struct log_msg *msg, uint32_t flags) |
#include <zephyr/logging/log_output.h>
Typedef of the function pointer table "format_table".
output | Pointer to log_output struct. |
msg | Pointer to log_msg struct. |
flags | Flags used for text formatting options. |
#include <zephyr/logging/log_output.h>
Prototype of the function processing output data.
buf | The buffer data. |
size | The buffer size. |
ctx | User context. |
void log_custom_output_msg_process | ( | const struct log_output * | log_output, |
struct log_msg * | msg, | ||
uint32_t | flags ) |
#include <zephyr/logging/log_output_custom.h>
Custom logging output formatting.
Process log messages from an external output function set with log_custom_output_msg_set
Function is using provided context with the buffer and output function to process formatted string and output the data.
log_output | Pointer to the log output instance. |
msg | Log message. |
flags | Optional flags. |
log_format_func_t log_format_func_t_get | ( | uint32_t | log_type | ) |
#include <zephyr/logging/log_output.h>
Declaration of the get routine for function pointer table format_table.
|
inlinestatic |
#include <zephyr/logging/log_output.h>
Function for setting user context passed to the output function.
output | Pointer to the log output instance. |
ctx | User context. |
void log_output_dropped_process | ( | const struct log_output * | output, |
uint32_t | cnt ) |
#include <zephyr/logging/log_output.h>
Process dropped messages indication.
Function prints error message indicating lost log messages.
output | Pointer to the log output instance. |
cnt | Number of dropped messages. |
|
inlinestatic |
#include <zephyr/logging/log_output.h>
Flush output buffer.
output | Pointer to the log output instance. |
|
inlinestatic |
#include <zephyr/logging/log_output.h>
Function for setting hostname of this device.
output | Pointer to the log output instance. |
hostname | Hostname of this device |
void log_output_msg_process | ( | const struct log_output * | log_output, |
struct log_msg * | msg, | ||
uint32_t | flags ) |
#include <zephyr/logging/log_output.h>
Process log messages v2 to readable strings.
Function is using provided context with the buffer and output function to process formatted string and output the data.
log_output | Pointer to the log output instance. |
msg | Log message. |
flags | Optional flags. See Log output formatting flags.. |
void log_output_msg_syst_process | ( | const struct log_output * | log_output, |
struct log_msg * | msg, | ||
uint32_t | flags ) |
#include <zephyr/logging/log_output.h>
Process log messages v2 to SYS-T format.
Function is using provided context with the buffer and output function to process formatted string and output the data in sys-t log output format.
log_output | Pointer to the log output instance. |
msg | Log message. |
flags | Optional flags. See Log output formatting flags.. |
void log_output_process | ( | const struct log_output * | log_output, |
log_timestamp_t | timestamp, | ||
const char * | domain, | ||
const char * | source, | ||
k_tid_t | tid, | ||
uint8_t | level, | ||
const uint8_t * | package, | ||
const uint8_t * | data, | ||
size_t | data_len, | ||
uint32_t | flags ) |
#include <zephyr/logging/log_output.h>
Process input data to a readable string.
log_output | Pointer to the log output instance. |
timestamp | Timestamp. |
domain | Domain name string. Can be NULL. |
source | Source name string. Can be NULL. |
tid | Thread ID. |
level | Criticality level. |
package | Cbprintf package with a logging message string. |
data | Data passed to hexdump API. Can be NULL. |
data_len | Data length. |
flags | Formatting flags. See Log output formatting flags.. |
void log_output_timestamp_freq_set | ( | uint32_t | freq | ) |
uint64_t log_output_timestamp_to_us | ( | log_timestamp_t | timestamp | ) |
#include <zephyr/logging/log_output.h>
Convert timestamp of the message to us.
timestamp | Message timestamp |
|
inlinestatic |
#include <zephyr/logging/log_output.h>
Write to the output buffer.
outf | Output function. |
buf | Buffer. |
len | Buffer length. |
ctx | Context passed to the p outf. |