Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Crash with message when trying to use a log level that is not allowed (without enable...
[simgrid.git] / src / xbt / log.c
index 607d2e2..c966b11 100644 (file)
@@ -24,7 +24,6 @@
 #include "xbt/dynar.h"
 #include "xbt/xbt_os_thread.h"
 
-XBT_PUBLIC_DATA(int) (*xbt_pid) ();
 int xbt_log_no_loc = 0;         /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
 static xbt_os_rmutex_t log_cat_init_mutex = NULL;
 
@@ -639,6 +638,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(msg_mailbox);
   XBT_LOG_CONNECT(msg_new_API);
   XBT_LOG_CONNECT(msg_process);
+  XBT_LOG_CONNECT(msg_synchro);
   XBT_LOG_CONNECT(msg_task);
   XBT_LOG_CONNECT(msg_vm);
    
@@ -1100,7 +1100,12 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
         break;
       }
     }
-    if (i < xbt_log_priority_infinite) {
+
+    if(i<XBT_LOG_STATIC_THRESHOLD){
+     THROWF(arg_error, 0,
+             "Priority: %s is above allowed priority : %s (for debug and trace levels, recompile SimGrid with -Denable_debug=ON)",
+             eq + 1, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
+    }else if (i < xbt_log_priority_infinite) {
       set->thresh = (e_xbt_log_priority_t) i;
     } else {
       THROWF(arg_error, 0,