* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "xbt/log_private.h"
-#include "gras/virtu.h" /* gras_os_myname (KILLME) */
-#include "xbt/synchro.h" /* xbt_thread_self_name */
+#include "src/xbt/log_private.h"
+#include "simgrid/simix.h" /* SIMIX_host_self_get_name */
+#include "surf/surf.h"
-#define show_string(data) show_it(data, "s")
+#define show_string(data) \
+ if (1) { \
+ const char *show_string_data = (data); \
+ show_it(show_string_data ? show_string_data : "(null)", "s"); \
+ } else (void)0
#define show_int(data) show_it(data, "d")
#define show_double(data) show_it(data, "f")
#define show_int(data) show_it(data, "d")
#define show_double(data) show_it(data, "f")
length = strtol(q, &q, 10);
goto handle_modifier;
case 'c': /* category name; LOG4J compliant
length = strtol(q, &q, 10);
goto handle_modifier;
case 'c': /* category name; LOG4J compliant
show_string(ev->cat->name);
break;
case 'p': /* priority name; LOG4J compliant */
show_string(xbt_log_priority_names[ev->priority]);
break;
case 'h': /* host name; SimGrid extension */
show_string(ev->cat->name);
break;
case 'p': /* priority name; LOG4J compliant */
show_string(xbt_log_priority_names[ev->priority]);
break;
case 'h': /* host name; SimGrid extension */
break;
case 'b': /* backtrace; called %throwable in LOG4J */
case 'B': /* short backtrace; called %throwable{short} in LOG4J */
break;
case 'b': /* backtrace; called %throwable in LOG4J */
case 'B': /* short backtrace; called %throwable{short} in LOG4J */