libkeymap 2.0.3 Library to manage the Linux keymaps

- Main Page
- Data Structures
- Files

- File List
- Globals

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:

  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.

## 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:

  ctx | is a keymap library context.
  priority | indicates the priority.