LV2: Logger

# LV2

An open and extensible audio plugin standard

Version | 1.18.10

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Functions
Logger
LV2 » Log

## Detailed Description

Convenience API for easy logging in plugin code.

This API provides simple wrappers for logging from a plugin, which automatically fall back to printing to stderr if host support is unavailable.

## Data Structures
struct | LV2_Log_Logger

## Functions
static void | lv2_log_logger_set_map (LV2_Log_Logger *logger, LV2_URID_Map *map)
static void | lv2_log_logger_init (LV2_Log_Logger *logger, LV2_URID_Map *map, LV2_Log_Log *log)
static int | lv2_log_vprintf (LV2_Log_Logger *logger, LV2_URID type, const char *fmt, va_list args)
static int | lv2_log_error (LV2_Log_Logger *logger, const char *fmt,...)
static int | lv2_log_note (LV2_Log_Logger *logger, const char *fmt,...)
static int | lv2_log_trace (LV2_Log_Logger *logger, const char *fmt,...)
static int | lv2_log_warning (LV2_Log_Logger *logger, const char *fmt,...)

## Data Structure Documentation

## ◆ LV2_Log_Logger

struct LV2_Log_Logger

Logger convenience API state.

Data Fields
LV2_Log_Log * | log |
LV2_URID | Error |
LV2_URID | Note |
LV2_URID | Trace |
LV2_URID | Warning |

## Function Documentation

## ◆ lv2_log_logger_set_map()

static void lv2_log_logger_set_map | ( | LV2_Log_Logger * | logger,
|  | LV2_URID_Map * | map
| ) |  |
| inlinestatic

Set `map` as the URI map for `logger`.

This affects the message type URIDs (Error, Warning, etc) which are passed to the log's print functions.

## ◆ lv2_log_logger_init()

static void lv2_log_logger_init | ( | LV2_Log_Logger * | logger,
|  | LV2_URID_Map * | map,
|  | LV2_Log_Log * | log
| ) |  |
| inlinestatic

Initialise `logger`.

URIs will be mapped using `map` and stored, a reference to `map` itself is not held. Both `map` and `log` may be NULL when unsupported by the host, in which case the implementation will fall back to printing to stderr.

## ◆ lv2_log_vprintf()

static int lv2_log_vprintf | ( | LV2_Log_Logger * | logger,
|  | LV2_URID | type,
|  | const char * | fmt,
|  | va_list | args
| ) |  |
| inlinestatic

Log a message to the host, or stderr if support is unavailable.

## ◆ lv2_log_error()

static int lv2_log_error | ( | LV2_Log_Logger * | logger,
|  | const char * | fmt,
|  |  | ...
| ) |  |
| inlinestatic

Log an error via lv2_log_vprintf().

## ◆ lv2_log_note()

static int lv2_log_note | ( | LV2_Log_Logger * | logger,
|  | const char * | fmt,
|  |  | ...
| ) |  |
| inlinestatic

Log a note via lv2_log_vprintf().

## ◆ lv2_log_trace()

static int lv2_log_trace | ( | LV2_Log_Logger * | logger,
|  | const char * | fmt,
|  |  | ...
| ) |  |
| inlinestatic

Log a trace via lv2_log_vprintf().

## ◆ lv2_log_warning()

static int lv2_log_warning | ( | LV2_Log_Logger * | logger,
|  | const char * | fmt,
|  |  | ...
| ) |  |
| inlinestatic

Log a warning via lv2_log_vprintf().