X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7af82e29ef89d022e278f4d420b9c7c83416145a..64561039d3dec9e50b4eaf1b78b3edef71898383:/src/xbt/log.c diff --git a/src/xbt/log.c b/src/xbt/log.c index f8c7a2398f..b4e3010b4c 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -372,10 +372,17 @@ library itself, or test programs doing strange things) do not display the process identity (thus, fmt is '[%%r] %%l: [%%c/%%p] %%m%%n' in that case, and '[%%r] [%%c/%%p] %%m%%n' if they are at priority INFO). -For now, there is only one format modifier: the precision field. You -can for example specify %.4r to get the application age with 4 -numbers after the radix. Another limitation is that you cannot set -specific layouts to the several priorities. +For now, there is only two format modifiers: the precision and the +width fields. You can for example specify %.4r to get the application +age with 4 numbers after the radix, or %15p to get the process name +on 15 columns. Finally, you can specify %10.6r to get the time on at +most 10 columns, with 6 numbers after the radix. + +Note that when specifying the width, it is filled with spaces. That +is to say that for example %5r in your format is converted to "% 5f" +for printf (note the extra space); there is no way to fill the empty +columns with 0 (ie, pass "%05f" to printf). Another limitation is +that you cannot set specific layouts to the several priorities. \subsection log_use_conf_app 3.1.4 Category appender @@ -1053,13 +1060,11 @@ void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay) cat->name); xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL)); } - if (cat->layout && cat != &_XBT_LOGV(root)) { - /* better leak the default layout than check every categories to - change it */ + if (cat->layout) { if (cat->layout->free_) { cat->layout->free_(cat->layout); - free(cat->layout); } + free(cat->layout); } cat->layout = lay; xbt_log_additivity_set(cat, 0);