liblightify
Support Functions

Functions

int lightify_set_log_fn (struct lightify_ctx *ctx, void(*log_fn)(struct lightify_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *format, va_list args))
 
int lightify_get_log_priority (struct lightify_ctx *ctx)
 
int lightify_set_log_priority (struct lightify_ctx *ctx, int priority)
 

Detailed Description

Function Documentation

int lightify_get_log_priority ( struct lightify_ctx ctx)

Get logging priority

Parameters
ctxcontext
Returns
current logging priority

Definition at line 99 of file log.c.

int lightify_set_log_fn ( struct lightify_ctx ctx,
void(*)(struct lightify_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *format, va_list args)  log_fn 
)

Setup logging callback.

Parameters
ctxlibrary context
log_fnfunction to be used for logging
Returns
negative on error, >=0 on success.
See also
lightify_set_log_fn for the default implementation

lightify_set_log_fn: : library context : function to be called for logging messages

The built-in logging writes to stderr. It can be overridden by a custom function, to plug log messages into the user's logging functionality.

Definition at line 89 of file log.c.

int lightify_set_log_priority ( struct lightify_ctx ctx,
int  priority 
)

Set logging priority

Parameters
ctxcontext
prioritypriotiry to be set.
Returns
>=0 on success

Definition at line 105 of file log.c.