|
LIBVLC_API void | libvlc_log_get_context (const libvlc_log_t *ctx, const char **module, const char **file, unsigned *line) |
|
LIBVLC_API void | libvlc_log_get_object (const libvlc_log_t *ctx, const char **name, const char **header, uintptr_t *id) |
|
LIBVLC_API void | libvlc_log_unset (libvlc_instance_t *) |
|
LIBVLC_API void | libvlc_log_set (libvlc_instance_t *, libvlc_log_cb cb, void *data) |
|
LIBVLC_API void | libvlc_log_set_file (libvlc_instance_t *, FILE *stream) |
|
LIBVLC_DEPRECATED LIBVLC_API
unsigned | libvlc_get_log_verbosity (const libvlc_instance_t *p_instance) |
|
LIBVLC_DEPRECATED LIBVLC_API void | libvlc_set_log_verbosity (libvlc_instance_t *p_instance, unsigned level) |
|
LIBVLC_DEPRECATED LIBVLC_API
libvlc_log_t * | libvlc_log_open (libvlc_instance_t *p_instance) |
|
LIBVLC_DEPRECATED LIBVLC_API void | libvlc_log_close (libvlc_log_t *p_log) |
|
LIBVLC_DEPRECATED LIBVLC_API
unsigned | libvlc_log_count (const libvlc_log_t *p_log) |
|
LIBVLC_DEPRECATED LIBVLC_API void | libvlc_log_clear (libvlc_log_t *p_log) |
|
LIBVLC_DEPRECATED LIBVLC_API
libvlc_log_iterator_t * | libvlc_log_get_iterator (const libvlc_log_t *p_log) |
|
LIBVLC_DEPRECATED LIBVLC_API void | libvlc_log_iterator_free (libvlc_log_iterator_t *p_iter) |
|
LIBVLC_DEPRECATED LIBVLC_API int | libvlc_log_iterator_has_next (const libvlc_log_iterator_t *p_iter) |
|
LIBVLC_DEPRECATED LIBVLC_API
libvlc_log_message_t * | libvlc_log_iterator_next (libvlc_log_iterator_t *p_iter, libvlc_log_message_t *p_buf) |
|
typedef struct
libvlc_log_iterator_t | libvlc_log_iterator_t |
|
typedef struct libvlc_log_message_t | libvlc_log_message_t |
|
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.
- Parameters
-
data | data pointer as given to libvlc_log_set() |
level | message level (enum libvlc_log_level) |
ctx | message context (meta-informations about the message) |
fmt | printf() format string (as defined by ISO C11) |
args | variable argument list for the format |
- Note
- Log message handlers must be thread-safe.
- Warning
- The message context pointer, the format string parameters and the variable arguments are only valid until the callback returns.
This structure is opaque. It represents a libvlc log iterator
Logging messages level.
- Note
- Future LibVLC versions may define new levels.
Enumerator |
---|
LIBVLC_DEBUG |
Debug message
|
LIBVLC_NOTICE |
Important informational message
|
LIBVLC_WARNING |
Warning (potential error) message
|
LIBVLC_ERROR |
Error message
|
LIBVLC_DEPRECATED LIBVLC_API unsigned libvlc_get_log_verbosity |
( |
const libvlc_instance_t * |
p_instance | ) |
|
Always returns minus one. This function is only provided for backward compatibility.
- Parameters
-
- Returns
- always -1
LIBVLC_DEPRECATED LIBVLC_API void libvlc_log_clear |
( |
libvlc_log_t * |
p_log | ) |
|
This function does nothing. It is only provided for backward compatibility.
- Parameters
-
LIBVLC_DEPRECATED LIBVLC_API void libvlc_log_close |
( |
libvlc_log_t * |
p_log | ) |
|
Frees memory allocated by libvlc_log_open().
- Parameters
-
p_log | libvlc log instance or NULL |
LIBVLC_DEPRECATED LIBVLC_API unsigned libvlc_log_count |
( |
const libvlc_log_t * |
p_log | ) |
|
Always returns zero. This function is only provided for backward compatibility.
- Parameters
-
- Returns
- always zero
LIBVLC_API void libvlc_log_get_context |
( |
const libvlc_log_t * |
ctx, |
|
|
const char ** |
module, |
|
|
const char ** |
file, |
|
|
unsigned * |
line |
|
) |
| |
Gets debugging informations about a log message: the name of the VLC module emitting the message and the message location within the source code.
The returned module name and file name will be NULL if unknown. The returned line number will similarly be zero if unknown.
- Parameters
-
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] |
- Warning
- The returned module name and source code file name, if non-NULL, are only valid until the logging callback returns.
- Version
- LibVLC 2.1.0 or later
This function does nothing useful. It is only provided for backward compatibility.
- Parameters
-
- Returns
- an unique pointer or NULL on error or if the parameter was NULL
LIBVLC_API void libvlc_log_get_object |
( |
const libvlc_log_t * |
ctx, |
|
|
const char ** |
name, |
|
|
const char ** |
header, |
|
|
uintptr_t * |
id |
|
) |
| |
Gets VLC object informations about a log message: the type name of the VLC object emitting the message, the object header if any and a temporaly-unique object identifier. These informations are 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.
- Parameters
-
ctx | message context (as passed to the libvlc_log_cb callback) |
name | object name storage (or NULL) [OUT] |
header | object header (or NULL) [OUT] |
line | source code file line number storage (or NULL) [OUT] |
- Warning
- The returned module name and source code file name, if non-NULL, are only valid until the logging callback returns.
- Version
- LibVLC 2.1.0 or later
Always returns zero. This function is only provided for backward compatibility.
- Parameters
-
- Returns
- always zero
Always returns NULL. This function is only provided for backward compatibility.
- Parameters
-
p_iter | libvlc log iterator or NULL |
p_buf | ignored |
- Returns
- always NULL
This function does nothing useful. It is only provided for backward compatibility.
- Parameters
-
p_instance | libvlc instance |
- Returns
- an unique pointer or NULL on error
Sets the logging callback for a LibVLC instance. This function is thread-safe: it will wait for any pending callbacks invocation to complete.
- Parameters
-
cb | callback function pointer |
data | opaque data pointer for the callback function |
- Note
- Some log messages (especially debug) are emitted by LibVLC while is being initialized. These messages cannot be captured with this interface.
- Warning
- A deadlock may occur if this function is called from the callback.
- Parameters
-
p_instance | libvlc instance |
- Version
- LibVLC 2.1.0 or later
Sets up logging to a file.
- Parameters
-
p_instance | libvlc instance |
stream | FILE pointer opened for writing (the FILE pointer must remain valid until libvlc_log_unset()) |
- Version
- LibVLC 2.1.0 or later
Unsets the logging callback for a LibVLC instance. This is rarely needed: the callback is implicitly unset when the instance is destroyed. This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback).
- Parameters
-
p_instance | libvlc instance |
- Version
- LibVLC 2.1.0 or later
LIBVLC_DEPRECATED LIBVLC_API void libvlc_set_log_verbosity |
( |
libvlc_instance_t * |
p_instance, |
|
|
unsigned |
level |
|
) |
| |
This function does nothing. It is only provided for backward compatibility.
- Parameters
-
p_instance | ignored |
level | ignored |