/**
* Message logging callback signature.
* \param data data pointer as provided to vlc_msg_SetCallback().
- * \param type message type (VLC_MSG_* values from enum msg_item_type)
+ * \param type message type (VLC_MSG_* values from enum vlc_log_type)
* \param item meta informations
* \param fmt format string
* \param args format string arguments
*/
-typedef void (*vlc_log_cb) (void *data, int type, const msg_item_t *item,
+typedef void (*vlc_log_cb) (void *data, int type, const vlc_log_t *item,
const char *fmt, va_list args);
VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data);
*/
/** Message types */
-enum msg_item_type
+enum vlc_log_type
{
VLC_MSG_INFO=0, /**< Important information */
VLC_MSG_ERR, /**< Error */
/**
* Log message
*/
-typedef struct
+typedef struct vlc_log_t
{
uintptr_t i_object_id; /**< Emitter (temporaly) unique object ID or 0 */
const char *psz_object_type; /**< Emitter object type name */
const char *psz_module; /**< Emitter module (source code) */
const char *psz_header; /**< Additional header (used by VLM media) */
-} msg_item_t;
+} vlc_log_t;
VLC_API void vlc_Log(vlc_object_t *, int,
const char *, const char *, ...) VLC_FORMAT( 4, 5 );
va_end (ap);
}
-static void libvlc_logf (void *dummy, int level, const msg_item_t *item,
+static void libvlc_logf (void *dummy, int level, const vlc_log_t *item,
const char *fmt, va_list ap)
{
char *msg;
- (IBAction)showMessagesPanel:(id)sender;
- (IBAction)updateMessagesPanel:(id)sender;
-- (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)type withStr: (char *)str;
+- (void)processReceivedlibvlcMessage:(const vlc_log_t *) item ofType: (int)type withStr: (char *)str;
- (void)updateTogglePlaylistState;
static bool checkProgressPanel (void *);
static void destroyProgressPanel (void *);
-static void MsgCallback(void *data, int type, const msg_item_t *item, const char *format, va_list ap);
+static void MsgCallback(void *data, int type, const vlc_log_t *item, const char *format, va_list ap);
static int InputEvent(vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *);
* ready to be displayed. We store everything in a NSArray in our Cocoa part
* of this file.
*****************************************************************************/
-static void MsgCallback(void *data, int type, const msg_item_t *item, const char *format, va_list ap)
+static void MsgCallback(void *data, int type, const vlc_log_t *item, const char *format, va_list ap)
{
int canc = vlc_savecancel();
char *str;
return @"";
}
-- (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)i_type withStr: (char *)str
+- (void)processReceivedlibvlcMessage:(const vlc_log_t *) item ofType: (int)i_type withStr: (char *)str
{
if (o_msg_arr) {
NSColor *o_white = [NSColor whiteColor];
struct
{
int type;
- msg_item_t *item;
+ vlc_log_t *item;
char *msg;
} msgs[50]; // ring buffer
int i_msgs;
vlc_mutex_lock(&sys->msg_lock);
int i = sys->i_msgs;
for(;;) {
- msg_item_t *msg = sys->msgs[i].item;
+ vlc_log_t *msg = sys->msgs[i].item;
if (msg) {
if (sys->color)
color_set(sys->msgs[i].type + C_INFO, NULL);
/*
*
*/
-static msg_item_t *msg_Copy (const msg_item_t *msg)
+static vlc_log_t *msg_Copy (const vlc_log_t *msg)
{
- msg_item_t *copy = (msg_item_t *)xmalloc (sizeof (*copy));
+ vlc_log_t *copy = (vlc_log_t *)xmalloc (sizeof (*copy));
copy->i_object_id = msg->i_object_id;
copy->psz_object_type = msg->psz_object_type;
copy->psz_module = strdup (msg->psz_module);
return copy;
}
-static void msg_Free (msg_item_t *msg)
+static void msg_Free (vlc_log_t *msg)
{
free ((char *)msg->psz_module);
free ((char *)msg->psz_header);
free (msg);
}
-static void MsgCallback(void *data, int type, const msg_item_t *msg,
+static void MsgCallback(void *data, int type, const vlc_log_t *msg,
const char *format, va_list ap)
{
intf_sys_t *sys = data;
class MsgEvent : public QEvent
{
public:
- MsgEvent( int, const msg_item_t *, const char * );
+ MsgEvent( int, const vlc_log_t *, const char * );
int priority;
uintptr_t object_id;
QString text;
};
-MsgEvent::MsgEvent( int type, const msg_item_t *msg, const char *text )
+MsgEvent::MsgEvent( int type, const vlc_log_t *msg, const char *text )
: QEvent( (QEvent::Type)MsgEvent_Type ),
priority( type ),
object_id( msg->i_object_id ),
: qtr("Clear the messages") );
}
-void MessagesDialog::MsgCallback( void *self, int type, const msg_item_t *item,
+void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
const char *format, va_list ap )
{
MessagesDialog *dialog = (MessagesDialog *)self;
virtual ~MessagesDialog();
Ui::messagesPanelWidget ui;
- static void sinkMessage( void *, msg_item_t *, unsigned );
+ static void sinkMessage( void *, vlc_log_t *, unsigned );
void customEvent( QEvent * );
void sinkMessage( const MsgEvent * );
bool matchFilter( const QString& );
vlc_atomic_t verbosity;
- static void MsgCallback( void *, int, const msg_item_t *, const char *,
+ static void MsgCallback( void *, int, const vlc_log_t *, const char *,
va_list );
private slots:
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static void TextPrint(void *, int, const msg_item_t *, const char *, va_list);
-static void HtmlPrint(void *, int, const msg_item_t *, const char *, va_list);
+static void TextPrint(void *, int, const vlc_log_t *, const char *, va_list);
+static void HtmlPrint(void *, int, const vlc_log_t *, const char *, va_list);
#ifdef HAVE_SYSLOG_H
-static void SyslogPrint(void *, int, const msg_item_t *, const char *,
- va_list);
+static void SyslogPrint(void *, int, const vlc_log_t *, const char *, va_list);
#endif
#ifdef __ANDROID__
-static void AndroidPrint(void *, int, const msg_item_t *, const char *, va_list);
+static void AndroidPrint(void *, int, const vlc_log_t *, const char *, va_list);
#endif
/*****************************************************************************
ANDROID_LOG_DEBUG
};
-static void AndroidPrint( void *opaque, int type, const msg_item_t *item,
+static void AndroidPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap )
{
(void)item;
}
#endif
-static void TextPrint( void *opaque, int type, const msg_item_t *item,
+static void TextPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap )
{
intf_thread_t *p_intf = opaque;
}
#ifdef HAVE_SYSLOG_H
-static void SyslogPrint( void *opaque, int type, const msg_item_t *item,
+static void SyslogPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap )
{
static const int i_prio[4] = { LOG_INFO, LOG_ERR, LOG_WARNING, LOG_DEBUG };
}
#endif
-static void HtmlPrint( void *opaque, int type, const msg_item_t *item,
+static void HtmlPrint( void *opaque, int type, const vlc_log_t *item,
const char *fmt, va_list ap )
{
static const unsigned color[4] = {
/* Logging */
struct
{
- void (*cb) (void *, int, const msg_item_t *, const char *, va_list);
+ void (*cb) (void *, int, const vlc_log_t *, const char *, va_list);
void *opaque;
vlc_rwlock_t lock;
} log;
}
#ifdef WIN32
-static void Win32DebugOutputMsg (void *, int , const msg_item_t *,
+static void Win32DebugOutputMsg (void *, int , const vlc_log_t *,
const char *, va_list);
#endif
#endif
/* Fill message information fields */
- msg_item_t msg;
+ vlc_log_t msg;
msg.i_object_id = (uintptr_t)obj;
msg.psz_object_type = (obj != NULL) ? obj->psz_object_type : "generic";
#define GRAY "\033[0m"
static const char msg_color[4][8] = { WHITE, RED, YELLOW, GRAY };
-static void PrintColorMsg (void *d, int type, const msg_item_t *p_item,
+static void PrintColorMsg (void *d, int type, const vlc_log_t *p_item,
const char *format, va_list ap)
{
FILE *stream = stderr;
vlc_restorecancel (canc);
}
-static void PrintMsg (void *d, int type, const msg_item_t *p_item,
+static void PrintMsg (void *d, int type, const vlc_log_t *p_item,
const char *format, va_list ap)
{
FILE *stream = stderr;
}
#ifdef WIN32
-static void Win32DebugOutputMsg (void* d, int type, const msg_item_t *p_item,
+static void Win32DebugOutputMsg (void* d, int type, const vlc_log_t *p_item,
const char *format, va_list dol)
{
VLC_UNUSED(p_item);