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...
authorAugustin Degomme <degomme@idpann.imag.fr>
Tue, 9 Jul 2013 12:29:42 +0000 (14:29 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Thu, 11 Jul 2013 19:26:34 +0000 (21:26 +0200)
include/xbt/log.h
src/xbt/log.c

index fe199ac..d631073 100644 (file)
@@ -60,7 +60,7 @@ typedef enum {
 
 /*
  * define NLOG to disable at compilation time any logging request
- * define NDEBUG to disable at compilation time any logging request of priority below INFO
+ * define NDEBUG to disable at compilation time any logging request of priority below VERBOSE
  */
 
 
index c560de6..c966b11 100644 (file)
@@ -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,