Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
log_output.h File Reference
#include <logging/log_msg.h>
#include <sys/util.h>
#include <stdarg.h>
#include <sys/atomic.h>

Go to the source code of this file.

Data Structures

struct  log_output_control_block
 
struct  log_output
 Log_output instance structure. More...
 

Macros

#define LOG_OUTPUT_FLAG_COLORS   BIT(0)
 Flag forcing ANSI escape code colors, red (errors), yellow (warnings). More...
 
#define LOG_OUTPUT_FLAG_TIMESTAMP   BIT(1)
 Flag forcing timestamp. More...
 
#define LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP   BIT(2)
 Flag forcing timestamp formatting. More...
 
#define LOG_OUTPUT_FLAG_LEVEL   BIT(3)
 Flag forcing severity level prefix. More...
 
#define LOG_OUTPUT_FLAG_CRLF_NONE   BIT(4)
 Flag preventing the logger from adding CR and LF characters. More...
 
#define LOG_OUTPUT_FLAG_CRLF_LFONLY   BIT(5)
 Flag forcing a single LF character for line breaks. More...
 
#define LOG_OUTPUT_FLAG_FORMAT_SYSLOG   BIT(6)
 Flag forcing syslog format specified in RFC 5424. More...
 
#define LOG_OUTPUT_FLAG_FORMAT_SYST   BIT(7)
 Flag forcing syslog format specified in mipi sys-t. More...
 
#define LOG_OUTPUT_DEFINE(_name, _func, _buf, _size)
 Create log_output instance. More...
 

Typedefs

typedef int(* log_output_func_t) (uint8_t *buf, size_t size, void *ctx)
 Prototype of the function processing output data. More...
 

Functions

void log_output_msg_process (const struct log_output *output, struct log_msg *msg, uint32_t flags)
 Process log messages to readable strings. More...
 
void log_output_msg2_process (const struct log_output *log_output, struct log_msg2 *msg, uint32_t flags)
 Process log messages v2 to readable strings. More...
 
void log_output_string (const struct log_output *output, struct log_msg_ids src_level, uint32_t timestamp, const char *fmt, va_list ap, uint32_t flags)
 Process log string. More...
 
void log_output_hexdump (const struct log_output *output, struct log_msg_ids src_level, uint32_t timestamp, const char *metadata, const uint8_t *data, uint32_t length, uint32_t flags)
 Process log hexdump. More...
 
void log_output_dropped_process (const struct log_output *output, uint32_t cnt)
 Process dropped messages indication. More...
 
void log_output_flush (const struct log_output *output)
 Flush output buffer. More...
 
static void log_output_ctx_set (const struct log_output *output, void *ctx)
 Function for setting user context passed to the output function. More...
 
static void log_output_hostname_set (const struct log_output *output, const char *hostname)
 Function for setting hostname of this device. More...
 
void log_output_timestamp_freq_set (uint32_t freq)
 Set timestamp frequency. More...
 
uint64_t log_output_timestamp_to_us (uint32_t timestamp)
 Convert timestamp of the message to us. More...