Commit d838f848 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

messages: add thread ID in message meta-data

parent 412dd754
...@@ -61,6 +61,7 @@ typedef struct vlc_log_t ...@@ -61,6 +61,7 @@ typedef struct vlc_log_t
const char *file; /**< Source code file name or NULL */ const char *file; /**< Source code file name or NULL */
int line; /**< Source code file line number or -1 */ int line; /**< Source code file line number or -1 */
const char *func; /**< Source code calling function name or NULL */ const char *func; /**< Source code calling function name or NULL */
unsigned long tid; /**< Emitter thread ID */
} vlc_log_t; } vlc_log_t;
VLC_API void vlc_Log(vlc_object_t *obj, int prio, const char *module, VLC_API void vlc_Log(vlc_object_t *obj, int prio, const char *module,
......
...@@ -52,6 +52,7 @@ static void Log(void *opaque, int type, const vlc_log_t *meta, ...@@ -52,6 +52,7 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
"CODE_LINE=%u", meta->line, "CODE_LINE=%u", meta->line,
"CODE_FUNC=%s", (meta->func != NULL) ? meta->func : "", "CODE_FUNC=%s", (meta->func != NULL) ? meta->func : "",
//"ERRNO=%d" //"ERRNO=%d"
"VLC_TID=%lu" /* change to OBJECT_TID if standardized */, meta->tid,
"VLC_OBJECT_ID=%"PRIxPTR, meta->i_object_id, "VLC_OBJECT_ID=%"PRIxPTR, meta->i_object_id,
"VLC_OBJECT_TYPE=%s", meta->psz_object_type, "VLC_OBJECT_TYPE=%s", meta->psz_object_type,
"VLC_MODULE=%s", meta->psz_module, "VLC_MODULE=%s", meta->psz_module,
......
...@@ -118,6 +118,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module, ...@@ -118,6 +118,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
msg.file = file; msg.file = file;
msg.line = line; msg.line = line;
msg.func = func; msg.func = func;
msg.tid = vlc_thread_id();
for (vlc_object_t *o = obj; o != NULL; o = o->p_parent) for (vlc_object_t *o = obj; o != NULL; o = o->p_parent)
if (o->psz_header != NULL) if (o->psz_header != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment