mikroSDK Reference Manual
log.h File Reference

Go to the source code of this file.

Data Structures

struct  log_t
 LOG context structure. More...
 
struct  log_cfg_t
 LOG init configuration structure. More...
 

Macros

#define ABS(x)   (((x)>0)?(x):-(x))
 Computes the absolute value of its argument x. More...
 
#define LOG_MAP_USB_UART(cfg)
 LOG MAP to the USB UART configuration. More...
 
#define LOG_MAP_MIKROBUS(cfg, mikrobus)
 LOG MAP to the MikroBUS configuration. More...
 

Enumerations

enum  log_level_t
 Log level values. More...
 

Functions

void log_init (log_t *log, log_cfg_t *cfg)
 Initializes LOG module. More...
 
void log_printf (log_t *log, const code char *__generic f,...)
 Printf function. More...
 
void log_clear (log_t *log)
 Discards all characters from the output and input buffer. More...
 
int8_t log_read (log_t *log, uint8_t *rx_data_buf, uint8_t max_len)
 Reads at most size bytes of data from the device into buffer. More...
 
void log_info (log_t *log, const code char *__generic f,...)
 INFO printf function. More...
 
void log_error (log_t *log, const code char *__generic f,...)
 ERROR printf function. More...
 
void log_fatal (log_t *log, const code char *__generic f,...)
 FATAL printf function. More...
 
void log_debug (log_t *log, const code char *__generic f,...)
 DEBUG printf function. More...
 
void log_warning (log_t *log, const code char *__generic f,...)
 WARNING printf function. More...
 
void log_log (log_t *log, char *prefix, const code char *__generic f,...)
 Printf function with a variable prefix. More...
 

Enumeration Type Documentation

◆ log_level_t

Enumerator
LOG_LEVEL_DEBUG 

Debug prefix.

LOG_LEVEL_INFO 

Information prefix.

LOG_LEVEL_WARNING 

Warning prefix.

LOG_LEVEL_ERROR 

Error prefix.

LOG_LEVEL_FATAL 

Fatal prefix.