# LV2

An open and extensible audio plugin standard

Version | 1.18.10

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()

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

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()

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

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()

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

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

## ◆ lv2_log_error()

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

Log an error via lv2_log_vprintf().

## ◆ lv2_log_note()

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

Log a note via lv2_log_vprintf().

## ◆ lv2_log_trace()

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

Log a trace via lv2_log_vprintf().

## ◆ lv2_log_warning()

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

Log a warning via lv2_log_vprintf().