libkeymap  2.0.4
Library to manage the Linux keymaps
Defines | Functions
src/libkeymap/keymap/logging.h File Reference

Functions for logging. More...

#include <syslog.h>
#include <keymap/context.h>

Go to the source code of this file.

Defines

#define lk_log_cond(ctx, level, arg...)
#define DBG(ctx, arg...)   lk_log_cond(ctx, LOG_DEBUG, ##arg)
#define INFO(ctx, arg...)   lk_log_cond(ctx, LOG_INFO, ##arg)
#define WARN(ctx, arg...)   lk_log_cond(ctx, LOG_WARNING, ##arg)
#define ERR(ctx, arg...)   lk_log_cond(ctx, LOG_ERR, ##arg)

Functions

void lk_log (struct lk_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *fmt,...)

Detailed Description

Functions for logging.


Define Documentation

#define lk_log_cond (   ctx,
  level,
  arg... 
)
Value:
do {                                                                     \
                if (ctx->log_priority >= level)                                  \
                        lk_log(ctx, level, __FILE__, __LINE__, __func__, ##arg); \
        } while (0)
#define DBG (   ctx,
  arg... 
)    lk_log_cond(ctx, LOG_DEBUG, ##arg)

Wrapper to output debug-level messages

Parameters:
ctxis a keymap library context.
argis output message.
#define INFO (   ctx,
  arg... 
)    lk_log_cond(ctx, LOG_INFO, ##arg)

Wrapper to output informational messages

Parameters:
ctxis a keymap library context.
argis output message.
#define WARN (   ctx,
  arg... 
)    lk_log_cond(ctx, LOG_WARNING, ##arg)

Wrapper to output warning conditions

Parameters:
ctxis a keymap library context.
argis output message.
#define ERR (   ctx,
  arg... 
)    lk_log_cond(ctx, LOG_ERR, ##arg)

Wrapper to output error conditions

Parameters:
ctxis a keymap library context.
argis output message.

Function Documentation

void lk_log ( struct lk_ctx *  ctx,
int  priority,
const char *  file,
int  line,
const char *  fn,
const char *  fmt,
  ... 
)

Logging function which uses log_fn and log_data to write log messages.

Parameters:
ctxis a keymap library context.
priorityindicates the priority.