From 056002da59af071ed3911e0d02f2e9f19996251e Mon Sep 17 00:00:00 2001 From: mquinson Date: Sun, 5 Aug 2007 15:42:11 +0000 Subject: [PATCH] %P is now the process name, and %t becomes the thread name (as it should for compliance with LOG4J). Note that here, thread name means pointer to the structure describing the thread... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3970 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/xbt_log_layout_format.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index 0b33f77387..190d5dc4c9 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -11,6 +11,7 @@ #include "xbt/sysdep.h" #include "xbt/log.h" #include "gras/virtu.h" +#include "xbt/synchro.h" /* xbt_thread_self */ #include extern const char *xbt_log_priority_names[7]; @@ -79,7 +80,11 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l, precision = -1; } break; - case 't': /* process name; LOG4J compliant (thread name) */ + case 't': /* thread name; LOG4J compliant */ + p += sprintf(p, "%p", xbt_thread_self()); + precision = -1; + break; + case 'P': /* process name; SimGrid extension */ if (precision == -1) p += sprintf(p, "%s", xbt_procname()); else { -- 2.20.1