VLC  3.0.15
Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Logging

Message logs. More...

Files

file  vlc_messages.h
 

Data Structures

struct  vlc_log_t
 Log message. More...
 

Macros

#define msg_GenericVa(o, p, fmt, ap)
 
#define msg_Generic(o, p, ...)
 
#define msg_Info(p_this, ...)   msg_Generic(p_this, VLC_MSG_INFO, __VA_ARGS__)
 
#define msg_Err(p_this, ...)   msg_Generic(p_this, VLC_MSG_ERR, __VA_ARGS__)
 
#define msg_Warn(p_this, ...)   msg_Generic(p_this, VLC_MSG_WARN, __VA_ARGS__)
 
#define msg_Dbg(p_this, ...)   msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)
 

Typedefs

typedef struct vlc_log_t vlc_log_t
 Log message. More...
 
typedef void(* vlc_log_cb) (void *data, int type, const vlc_log_t *item, const char *fmt, va_list args)
 Message logging callback signature. More...
 

Enumerations

enum  vlc_log_type { VLC_MSG_INFO =0, VLC_MSG_ERR, VLC_MSG_WARN, VLC_MSG_DBG }
 Message types. More...
 

Functions

void vlc_Log (vlc_object_t *obj, int prio, const char *module, const char *file, unsigned line, const char *func, const char *format,...)
 Emit a log message. More...
 
void vlc_vaLog (vlc_object_t *obj, int prio, const char *module, const char *file, unsigned line, const char *func, const char *format, va_list ap)
 Emit a log message. More...
 
const char * vlc_strerror (int)
 Formats an error message in the current locale. More...
 
const char * vlc_strerror_c (int)
 Formats an error message in the POSIX/C locale (i.e. More...
 

Variables

const char vlc_module_name []
 
void vlc_LogSet (libvlc_int_t *, vlc_log_cb cb, void *data)
 Sets the message logging callback. More...
 

Detailed Description

Message logs.

Functions for modules to emit log messages.

Macro Definition Documentation

◆ msg_Dbg

#define msg_Dbg (   p_this,
  ... 
)    msg_Generic(p_this, VLC_MSG_DBG, __VA_ARGS__)

◆ msg_Err

#define msg_Err (   p_this,
  ... 
)    msg_Generic(p_this, VLC_MSG_ERR, __VA_ARGS__)

◆ msg_Generic

#define msg_Generic (   o,
  p,
  ... 
)
Value:
vlc_Log(VLC_OBJECT(o), p, vlc_module_name, __FILE__, __LINE__, \
__func__, __VA_ARGS__)

◆ msg_GenericVa

#define msg_GenericVa (   o,
  p,
  fmt,
  ap 
)
Value:
vlc_vaLog(VLC_OBJECT(o), p, vlc_module_name, __FILE__, __LINE__, \
__func__, fmt, ap)

◆ msg_Info

#define msg_Info (   p_this,
  ... 
)    msg_Generic(p_this, VLC_MSG_INFO, __VA_ARGS__)

◆ msg_Warn

#define msg_Warn (   p_this,
  ... 
)    msg_Generic(p_this, VLC_MSG_WARN, __VA_ARGS__)

Typedef Documentation

◆ vlc_log_cb

typedef void(* vlc_log_cb) (void *data, int type, const vlc_log_t *item, const char *fmt, va_list args)

Message logging callback signature.

Parameters
datadata pointer as provided to vlc_msg_SetCallback().
typemessage type (VLC_MSG_* values from enum vlc_log_type)
itemmeta information
fmtformat string
argsformat string arguments

◆ vlc_log_t

typedef struct vlc_log_t vlc_log_t

Log message.

Enumeration Type Documentation

◆ vlc_log_type

Message types.

Enumerator
VLC_MSG_INFO 

Important information.

VLC_MSG_ERR 

Error.

VLC_MSG_WARN 

Warning.

VLC_MSG_DBG 

Debug.

Function Documentation

◆ vlc_Log()

void vlc_Log ( vlc_object_t obj,
int  type,
const char *  module,
const char *  file,
unsigned  line,
const char *  func,
const char *  format,
  ... 
)

Emit a log message.

Parameters
objVLC object emitting the message or NULL
typeVLC_MSG_* message type (info, error, warning or debug)
modulename of module from which the message come (normally vlc_module_name)
filesource module file name (normally FILE) or NULL
linefunction call source line number (normally LINE) or 0
funccalling function name (normally func) or NULL
formatprintf-like message format

References vlc_vaLog().

◆ vlc_LogSet()

void vlc_LogSet ( libvlc_int_t vlc,
vlc_log_cb  cb,
void *  opaque 
)

Sets the message logging callback.

Parameters
cbmessage callback, or NULL to clear
datadata pointer for the message callback

References libvlc_priv(), vlc_logger_t::lock, vlc_logger_t::log, libvlc_priv_t::logger, vlc_logger_t::module, msg_Dbg, psz_vlc_changeset, vlc_logger_t::sys, unlikely, vlc_logger_unload(), vlc_module_unload, vlc_rwlock_unlock(), vlc_rwlock_wrlock(), and vlc_vaLogDiscard().

◆ vlc_strerror()

const char* vlc_strerror ( int  errnum)

Formats an error message in the current locale.

Parameters
errnumerror number (as in errno.h)
Returns
A string pointer, valid until the next call to a function of the strerror() family in the same thread. This function cannot fail.

References vlc_strerror_c(), and vlc_strerror_l().

◆ vlc_strerror_c()

const char* vlc_strerror_c ( int  errnum)

◆ vlc_vaLog()

void vlc_vaLog ( vlc_object_t obj,
int  type,
const char *  module,
const char *  file,
unsigned  line,
const char *  func,
const char *  format,
va_list  args 
)

Variable Documentation

◆ vlc_module_name

const char vlc_module_name[]
vlc_Log
void vlc_Log(vlc_object_t *obj, int prio, const char *module, const char *file, unsigned line, const char *func, const char *format,...)
Emit a log message.
Definition: messages.c:152
vlc_vaLog
void vlc_vaLog(vlc_object_t *obj, int prio, const char *module, const char *file, unsigned line, const char *func, const char *format, va_list ap)
Emit a log message.
Definition: messages.c:87
vlc_module_name
const char vlc_module_name[]
VLC_OBJECT
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition: vlc_common.h:464
p
#define p(t)