Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not throw exception on problem, since we will be called again to display it when...
[simgrid.git] / src / xbt / xbt_log_layout_format.c
index 3321e5a..0b33f77 100644 (file)
@@ -12,7 +12,6 @@
 #include "xbt/log.h"
 #include "gras/virtu.h"
 #include <stdio.h>
-#include "xbt/ex_interface.h" /* backtraces */
 
 extern const char *xbt_log_priority_names[7];
 
@@ -37,7 +36,8 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l,
        handle_modifier:
       switch (*q) {
       case '\0':
-       THROW1(arg_error,0,"Layout format (%s) ending with %%",(char*)l->data);
+       fprintf(stderr,"Layout format (%s) ending with %%\n",(char*)l->data);
+       abort();
       case '%':
        *p++ = '%';
        break;
@@ -89,9 +89,9 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l,
        break;
       case 'i': /* process PID name; SimGrid extension */
        if (precision == -1)
-          p += sprintf(p, "%ld", gras_os_getpid());
+          p += sprintf(p, "%d", (*xbt_getpid)());
         else {       
-          p += sprintf(p, "%.*ld", precision, gras_os_getpid());
+          p += sprintf(p, "%.*d", precision, (*xbt_getpid)());
           precision = -1;
        }        
        break;
@@ -139,7 +139,7 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l,
          e.bt_strings = NULL;
          e.msg=NULL;
          e.remote=0;
-         xbt_ex_setup_backtrace(&e);
+         xbt_backtrace_current(&e);
          if (*q=='B') {
             if (precision == -1)
               p += sprintf(p,"%s",e.bt_strings[2]+8);
@@ -191,8 +191,9 @@ static char *xbt_log_layout_format_doit(xbt_log_layout_t l,
        break;
 
       default:
-       THROW2(arg_error,0,"Unknown %%%c sequence in layout format (%s)",
-              *q,(char*)l->data);
+       fprintf(stderr,"Unknown %%%c sequence in layout format (%s)\n",
+               *q,(char*)l->data);
+       abort();
       }
       q++;
     } else {