Skip to content

Commit

Permalink
messages: add thread ID in message meta-data
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed May 25, 2016
1 parent 412dd75 commit d838f84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/vlc_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct vlc_log_t
const char *file; /**< Source code file name or NULL */
int line; /**< Source code file line number or -1 */
const char *func; /**< Source code calling function name or NULL */
unsigned long tid; /**< Emitter thread ID */
} vlc_log_t;

VLC_API void vlc_Log(vlc_object_t *obj, int prio, const char *module,
Expand Down
1 change: 1 addition & 0 deletions modules/logger/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
"CODE_LINE=%u", meta->line,
"CODE_FUNC=%s", (meta->func != NULL) ? meta->func : "",
//"ERRNO=%d"
"VLC_TID=%lu" /* change to OBJECT_TID if standardized */, meta->tid,
"VLC_OBJECT_ID=%"PRIxPTR, meta->i_object_id,
"VLC_OBJECT_TYPE=%s", meta->psz_object_type,
"VLC_MODULE=%s", meta->psz_module,
Expand Down
1 change: 1 addition & 0 deletions src/misc/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void vlc_vaLog (vlc_object_t *obj, int type, const char *module,
msg.file = file;
msg.line = line;
msg.func = func;
msg.tid = vlc_thread_id();

for (vlc_object_t *o = obj; o != NULL; o = o->p_parent)
if (o->psz_header != NULL)
Expand Down

0 comments on commit d838f84

Please sign in to comment.