VLC  4.0.0-dev
Data Structures | Macros | Typedefs | Functions

Message log back-end. More...

Collaboration diagram for Logger:

Data Structures

struct  vlc_logger_operations
 

Macros

#define vlc_log_gen(logger, prio, ...)
 
#define vlc_info(logger, ...)   vlc_log_gen(logger, VLC_MSG_INFO, __VA_ARGS__)
 
#define vlc_error(logger, ...)   vlc_log_gen(logger, VLC_MSG_ERR, __VA_ARGS__)
 
#define vlc_warning(logger, ...)   vlc_log_gen(logger, VLC_MSG_WARN, __VA_ARGS__)
 
#define vlc_debug(logger, ...)   vlc_log_gen(logger, VLC_MSG_DBG, __VA_ARGS__)
 

Typedefs

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...
 

Functions

VLC_EXPORT void vlc_Log (struct vlc_logger *const *logger, int prio, const char *type, const char *module, const char *file, unsigned line, const char *func, const char *format,...)
 
VLC_EXPORT void vlc_vaLog (struct vlc_logger *const *logger, int prio, const char *type, const char *module, const char *file, unsigned line, const char *func, const char *format, va_list ap)
 
VLC_EXPORT struct vlc_loggervlc_LogHeaderCreate (struct vlc_logger *parent, const char *str)
 Creates a prefixed message log. More...
 
VLC_EXPORT void vlc_LogDestroy (struct vlc_logger *)
 Destroys a message log. More...
 

Detailed Description

Message log back-end.

Macro Definition Documentation

◆ vlc_debug

#define vlc_debug (   logger,
  ... 
)    vlc_log_gen(logger, VLC_MSG_DBG, __VA_ARGS__)

◆ vlc_error

#define vlc_error (   logger,
  ... 
)    vlc_log_gen(logger, VLC_MSG_ERR, __VA_ARGS__)

◆ vlc_info

#define vlc_info (   logger,
  ... 
)    vlc_log_gen(logger, VLC_MSG_INFO, __VA_ARGS__)

◆ vlc_log_gen

#define vlc_log_gen (   logger,
  prio,
  ... 
)
Value:
vlc_Log(&(logger), prio, "generic", vlc_module_name, \
__FILE__, __LINE__, __func__, __VA_ARGS__)

◆ vlc_warning

#define vlc_warning (   logger,
  ... 
)    vlc_log_gen(logger, 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

Function Documentation

◆ vlc_Log()

VLC_EXPORT void vlc_Log ( struct vlc_logger *const *  logger,
int  prio,
const char *  type,
const char *  module,
const char *  file,
unsigned  line,
const char *  func,
const char *  format,
  ... 
)

References vlc_vaLog().

◆ vlc_LogDestroy()

VLC_EXPORT void vlc_LogDestroy ( struct vlc_logger )

Destroys a message log.

References vlc_logger_operations::destroy, and vlc_logger::ops.

Referenced by libvlc_InternalCleanup(), and vlm_ControlMediaDel().

◆ vlc_LogHeaderCreate()

VLC_EXPORT struct vlc_logger* vlc_LogHeaderCreate ( struct vlc_logger parent,
const char *  str 
)

Creates a prefixed message log.

This creates a message log that prefixes all its messages and forwards them in another log.

Parameters
parentmessage log to inject into
strnul-terminated prefix (a.k.a. "header")
Returns
a new message log on success or NULL on error

References vlc_logger_header::header, header_ops, vlc_logger_header::parent, and unlikely.

Referenced by vlm_ControlMediaAdd().

◆ vlc_vaLog()

VLC_EXPORT void vlc_vaLog ( struct vlc_logger *const *  logger,
int  prio,
const char *  type,
const char *  module,
const char *  file,
unsigned  line,
const char *  func,
const char *  format,
va_list  ap 
)
vlc_Log
VLC_EXPORT void vlc_Log(struct vlc_logger *const *logger, int prio, const char *type, const char *module, const char *file, unsigned line, const char *func, const char *format,...)
Definition: messages.c:131
vlc_module_name
const char vlc_module_name[]