## Logging Logging — Logging functions |

## Functions

#define | fp_dbg_hex_dump_bytes()
#define | fp_dbg_hex_dump_data()
gboolean | fpi_log_is_debug_transfer_enabled ()
#define | BUG_ON()
#define | BUG

## Types and Values

#define | fp_dbg
#define | fp_info
#define | fp_warn
#define | fp_err

## Description

Logging in libfprint is handled through GLib's logging system, and behave the same way as in the GLib Message Output and Debugging Functions documentation.

You should include `fpi-log.h` as early as possible in your sources, just after setting the `FP_COMPONENT` define to a string unique to your sources. This will set the suffix of the `G_LOG_DOMAIN` used for printing.

## Functions

### fp_dbg_hex_dump_bytes()

    #define             fp_dbg_hex_dump_bytes(bytes)

Prints hex dump of `bytes` to `fp_dbg()`

#### Parameters

bytes | GBytes to dump |

### fp_dbg_hex_dump_data()

    #define             fp_dbg_hex_dump_data(buf, len)

Prints hex dump of `buf` to `fp_dbg()`

#### Parameters

buf | Bytes buffer to dump |
len | Length of `buf` to dump |

### fpi_log_is_debug_transfer_enabled ()

    gboolean
    fpi_log_is_debug_transfer_enabled (void);

Checks if the `FP_DEBUG_TRANSFER` environment variable is set.

#### Returns

`TRUE` if `FP_DEBUG_TRANSFER` is set, `FALSE` otherwise

### BUG_ON()

    #define             BUG_ON(condition)

Uses `fp_err()` to print an error if the `condition` is true.

#### Parameters

condition | the condition to check |

### BUG

    #define BUG() BUG_ON (1)

Same as `BUG_ON()` but is always true.

## Types and Values

### fp_dbg

    #define fp_dbg g_debug

Same as `g_debug()`.

### fp_info

    #define fp_info g_debug

Same as `g_debug()`.

### fp_warn

    #define fp_warn g_warning

Same as `g_warning()`.

### fp_err

    #define fp_err g_critical

Same as `g_critical()`. In the future, this might be changed to a `g_assert()` instead, so bear this in mind when adding those calls to your driver.