Files

file  klog.h
 Logging module.
 

Data Structures

struct  klog_config
 
struct  klog_handle
 

Macros

#define KLOG_MAX_LINE   255
 
#define KLOG(handle, level, logger, ...)   klog_write(handle, level, logger, __VA_ARGS__)
 
#define KLOG_ERR(handle, logger, ...)   KLOG(handle, LOG_ERROR, logger, __VA_ARGS__)
 
#define KLOG_WARN(handle, logger, ...)   KLOG(handle, LOG_WARNING, logger, __VA_ARGS__)
 
#define KLOG_TELEMETRY(handle, logger, ...)   KLOG(handle, LOG_TELEMETRY, logger, __VA_ARGS__)
 
#define KLOG_INFO(handle, logger, ...)   KLOG(handle, LOG_INFO, logger, __VA_ARGS__)
 
#define KLOG_DEBUG(handle, logger, ...)   KLOG(handle, LOG_DEBUG, logger, __VA_ARGS__)
 
#define KLOG_SUFFIX_LEN   4
 
#define KLOG_PATH_LEN   255
 
#define KLOG_MAX_PATH   (KLOG_PATH_LEN - KLOG_SUFFIX_LEN - 1)
 
#define KLOG_PART_SIZE_DEFAULT   (1024 * 512)
 
#define KLOG_MAX_PARTS_DEFAULT   4
 
#define klog_write(handle, level, logger, ...)
 

Functions

int klog_init_file (klog_handle *handle)
 
void klog_console (unsigned level, const char *logger, const char *format,...)
 
void klog_file (klog_handle *handle, unsigned level, const char *logger, const char *format,...)
 
void klog_cleanup (klog_handle *handle)
 

Macro Definition Documentation

#define KLOG (   handle,
  level,
  logger,
  ... 
)    klog_write(handle, level, logger, __VA_ARGS__)
#define KLOG_DEBUG (   handle,
  logger,
  ... 
)    KLOG(handle, LOG_DEBUG, logger, __VA_ARGS__)
#define KLOG_ERR (   handle,
  logger,
  ... 
)    KLOG(handle, LOG_ERROR, logger, __VA_ARGS__)
#define KLOG_INFO (   handle,
  logger,
  ... 
)    KLOG(handle, LOG_INFO, logger, __VA_ARGS__)
#define KLOG_MAX_LINE   255
#define KLOG_MAX_PARTS_DEFAULT   4
#define KLOG_MAX_PATH   (KLOG_PATH_LEN - KLOG_SUFFIX_LEN - 1)
#define KLOG_PART_SIZE_DEFAULT   (1024 * 512)
#define KLOG_PATH_LEN   255
#define KLOG_SUFFIX_LEN   4
#define KLOG_TELEMETRY (   handle,
  logger,
  ... 
)    KLOG(handle, LOG_TELEMETRY, logger, __VA_ARGS__)
#define KLOG_WARN (   handle,
  logger,
  ... 
)    KLOG(handle, LOG_WARNING, logger, __VA_ARGS__)
#define klog_write (   handle,
  level,
  logger,
  ... 
)
Value:
do { \
if (level <= ((handle)->config.klog_console_level)) { \
klog_console(level, logger, __VA_ARGS__); \
} \
if (level <= ((handle)->config.klog_file_level) && ((handle)->config.klog_file_logging)) { \
klog_file(handle, level, logger, __VA_ARGS__); \
} \
} while (0)
void klog_console(unsigned level, const char *logger, const char *format,...)
void klog_file(klog_handle *handle, unsigned level, const char *logger, const char *format,...)

Function Documentation

void klog_cleanup ( klog_handle handle)
void klog_console ( unsigned  level,
const char *  logger,
const char *  format,
  ... 
)
void klog_file ( klog_handle handle,
unsigned  level,
const char *  logger,
const char *  format,
  ... 
)
int klog_init_file ( klog_handle handle)