Functions for logging.
More...
#include <syslog.h>
#include <keymap/context.h>
Go to the source code of this file.
|
#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) |
|
|
void | lk_log (struct lk_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *fmt,...) |
|
#define lk_log_cond |
( |
|
ctx, |
|
|
|
level, |
|
|
|
arg... |
|
) |
| |
Value:do { \
if (ctx->log_priority >= level)
\
lk_log(ctx, level, __FILE__, __LINE__, __func__, ##arg); \
} while (0)
void lk_log(struct lk_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *fmt,...)
#define DBG |
( |
|
ctx, |
|
|
|
arg... |
|
) |
| lk_log_cond(ctx, LOG_DEBUG, ##arg) |
Wrapper to output debug-level messages
- Parameters
-
ctx | is a keymap library context. |
arg | is output message. |
#define INFO |
( |
|
ctx, |
|
|
|
arg... |
|
) |
| lk_log_cond(ctx, LOG_INFO, ##arg) |
Wrapper to output informational messages
- Parameters
-
ctx | is a keymap library context. |
arg | is output message. |
#define WARN |
( |
|
ctx, |
|
|
|
arg... |
|
) |
| lk_log_cond(ctx, LOG_WARNING, ##arg) |
Wrapper to output warning conditions
- Parameters
-
ctx | is a keymap library context. |
arg | is output message. |
#define ERR |
( |
|
ctx, |
|
|
|
arg... |
|
) |
| lk_log_cond(ctx, LOG_ERR, ##arg) |
Wrapper to output error conditions
- Parameters
-
ctx | is a keymap library context. |
arg | is output message. |
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
-
ctx | is a keymap library context. |
priority | indicates the priority. |