|
VLC 4.0.0-dev
|
libvlc_log_* functions provide access to the LibVLC messages log. More...
Typedefs | |
| typedef struct vlc_log_t | libvlc_log_t |
| typedef void(* | libvlc_log_cb) (void *data, int level, const libvlc_log_t *ctx, const char *fmt, va_list args) |
| Callback prototype for LibVLC log message handler. | |
Enumerations | |
| enum | libvlc_log_level { LIBVLC_DEBUG =0 , LIBVLC_NOTICE =2 , LIBVLC_WARNING =3 , LIBVLC_ERROR =4 } |
| Logging messages level. More... | |
Functions | |
| void | libvlc_log_get_context (const libvlc_log_t *ctx, const char **module, const char **file, unsigned *line) |
| Gets log message debug infos. | |
| void | libvlc_log_get_object (const libvlc_log_t *ctx, const char **name, const char **header, uintptr_t *id) |
| Gets log message info. | |
| void | libvlc_log_unset (libvlc_instance_t *p_instance) |
| Unsets the logging callback. | |
| void | libvlc_log_set (libvlc_instance_t *p_instance, libvlc_log_cb cb, void *data) |
| Sets the logging callback for a LibVLC instance. | |
| void | libvlc_log_set_file (libvlc_instance_t *p_instance, FILE *stream) |
| Sets up logging to a file. | |
libvlc_log_* functions provide access to the LibVLC messages log.
This is used for logging and debugging.
| typedef void(* libvlc_log_cb) (void *data, int level, const libvlc_log_t *ctx, const char *fmt, va_list args) |
Callback prototype for LibVLC log message handler.
| data | data pointer as given to libvlc_log_set() |
| level | message level (libvlc_log_level) |
| ctx | message context (meta-information about the message) |
| fmt | printf() format string (as defined by ISO C11) |
| args | variable argument list for the format |
| typedef struct vlc_log_t libvlc_log_t |
| enum libvlc_log_level |
| void libvlc_log_get_context | ( | const libvlc_log_t * | ctx, |
| const char ** | module, | ||
| const char ** | file, | ||
| unsigned * | line ) |
Gets log message debug infos.
This function retrieves self-debug information about a log message:
The returned module name and file name will be NULL if unknown. The returned line number will similarly be zero if unknown.
| ctx | message context (as passed to the libvlc_log_cb callback) |
| module | module name storage (or NULL) [OUT] |
| file | source code file name storage (or NULL) [OUT] |
| line | source code file line number storage (or NULL) [OUT] |
References LIBVLC_API.
| void libvlc_log_get_object | ( | const libvlc_log_t * | ctx, |
| const char ** | name, | ||
| const char ** | header, | ||
| uintptr_t * | id ) |
Gets log message info.
This function retrieves meta-information about a log message:
This information is mainly meant for manual troubleshooting.
The returned type name may be "generic" if unknown, but it cannot be NULL. The returned header will be NULL if unset; in current versions, the header is used to distinguish for VLM inputs. The returned object ID will be zero if the message is not associated with any VLC object.
| ctx | message context (as passed to the libvlc_log_cb callback) |
| name | object name storage (or NULL) [OUT] |
| header | object header (or NULL) [OUT] |
| id | temporarily-unique object identifier (or 0) [OUT] |
References LIBVLC_API, and name.
| void libvlc_log_set | ( | libvlc_instance_t * | p_instance, |
| libvlc_log_cb | cb, | ||
| void * | data ) |
Sets the logging callback for a LibVLC instance.
This function is thread-safe: it will wait for any pending callbacks invocation to complete.
| cb | callback function pointer |
| data | opaque data pointer for the callback function |
| p_instance | libvlc instance |
References LIBVLC_API.
| void libvlc_log_set_file | ( | libvlc_instance_t * | p_instance, |
| FILE * | stream ) |
Sets up logging to a file.
| p_instance | libvlc instance |
| stream | FILE pointer opened for writing (the FILE pointer must remain valid until libvlc_log_unset()) |
References LIBVLC_API.
| void libvlc_log_unset | ( | libvlc_instance_t * | p_instance | ) |
Unsets the logging callback.
This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed.
| p_instance | libvlc instance |
References LIBVLC_API.