X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f8ccf96fc8f0185acb6d66f56245b92cd57bc865..c3f8997103629ced10eb0115bcbf771e5217ce9d:/src/xbt/log.c diff --git a/src/xbt/log.c b/src/xbt/log.c index a3da1357da..19e09b73eb 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -2,7 +2,7 @@ /* log - a generic logging facility in the spirit of log4j */ -/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2003-2007 Martin Quinson. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -20,7 +20,7 @@ #include "xbt/misc.h" #include "xbt/ex.h" #include "xbt/sysdep.h" -#include "xbt/log.h" +#include "xbt/log_private.h" #include "xbt/dynar.h" XBT_PUBLIC_DATA(int) (*xbt_pid)(); @@ -582,12 +582,12 @@ void _xbt_log_event_log( xbt_log_event_t ev, const char *fmt, ...) { } va_start(ev->ap, fmt); + va_start(ev->ap_copy, fmt); while(1) { xbt_log_appender_t appender = cat->appender; if (appender != NULL) { xbt_assert1(cat->layout,"No valid layout for the appender of category %s",cat->name); - cat->layout->do_layout(cat->layout, ev, fmt); - appender->do_append(appender, ev->buffer); + cat->layout->do_layout(cat->layout, ev, fmt, appender); } if (!cat->additivity) break; @@ -595,6 +595,7 @@ void _xbt_log_event_log( xbt_log_event_t ev, const char *fmt, ...) { cat = cat->parent; } va_end(ev->ap); + va_end(ev->ap_copy); } static void _xbt_log_cat_apply_set(xbt_log_category_t category, @@ -661,7 +662,7 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category, */ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority) { - int cursor; + unsigned int cursor; xbt_log_setting_t setting=NULL; int found = 0; s_xbt_log_event_t _log_ev; @@ -955,7 +956,7 @@ void xbt_log_control_set(const char* control_string) { /* To split the string in commands, and the cursors */ xbt_dynar_t set_strings; char *str; - int cpt; + unsigned int cpt; if (!control_string) return;