X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5119d31da6d329bfcf55d56333e554e1ce1de5e1..593ae86304a79fe1420cb52505733e079a119ed3:/src/xbt/log.c diff --git a/src/xbt/log.c b/src/xbt/log.c index 16ad6ab84e..4b72fff99e 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -13,6 +13,7 @@ #include /* snprintf */ #include /* snprintf */ #include "gras_config.h" /* to get a working stdarg.h */ +#include "portable.h" /* to get a working stdarg.h */ #include "xbt_modinter.h" @@ -46,6 +47,7 @@ - \ref log_internals - \ref log_in_perf - \ref log_in_app + - \ref XBT_log_cats \section log_overview 1. Introduction @@ -124,13 +126,13 @@ the category's parent. A category is created by a macro call at the top level of a file. A category can be created with any one of the following macros: - - \ref XBT_LOG_NEW_CATEGORY(MyCat); Create a new root - - \ref XBT_LOG_NEW_SUBCATEGORY(MyCat, ParentCat); + - \ref XBT_LOG_NEW_CATEGORY(MyCat,desc); Create a new root + - \ref XBT_LOG_NEW_SUBCATEGORY(MyCat, ParentCat,desc); Create a new category being child of the category ParentCat - - \ref XBT_LOG_NEW_DEFAULT_CATEGORY(MyCat); + - \ref XBT_LOG_NEW_DEFAULT_CATEGORY(MyCat,desc); Like XBT_LOG_NEW_CATEGORY, but the new category is the default one in this file - - \ref XBT_LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, ParentCat); + - \ref XBT_LOG_NEW_DEFAULT_SUBCATEGORY(MyCat, ParentCat,desc); Like XBT_LOG_NEW_SUBCATEGORY, but the new category is the default one in this file @@ -546,7 +548,7 @@ static void _xbt_log_parse_setting(const char* control_string, xbt_assert1(*dot == '.' && *eq == '=', "Invalid control string '%s'",control_string); - if (!strncmp(dot + 1, "thresh", min(eq - dot - 1,strlen("thresh")))) { + if (!strncmp(dot + 1, "thresh", min((size_t)(eq - dot - 1),strlen("thresh")))) { int i; char *neweq=xbt_strdup(eq+1); char *p=neweq-1; @@ -565,7 +567,7 @@ static void _xbt_log_parse_setting(const char* control_string, } } if (ithresh=i; + set->thresh= (e_xbt_log_priority_t) i; } else { xbt_assert1(FALSE,"Unknown priority name: %s",eq+1); } @@ -665,14 +667,14 @@ void xbt_log_control_set(const char* control_string) { _cleanup_double_spaces(cs); while (!done) { - xbt_log_category_t cat; - int found; + xbt_log_category_t cat=NULL; + int found=0; xbt_ex_t e; p=strrchr(cs,' '); if (p) { *p='\0'; - *p++; + p++; } else { p=cs; done = 1;