/* 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. */
+
#include "Core/core_interface.h"
#include "gras_private.h"
#include <stdarg.h>
const char *gras_log_priority_names[8] = {
"NONE",
+ "TRACE",
"DEBUG",
"VERBOSE",
"INFO",
if (cat->threshold <= gras_log_priority_verbose) {
gras_log_event_t _log_ev =
- {cat,gras_log_priority_verbose,__FILE__,__FUNCTION__,__LINE__,
- "Apply settings for category '%s': set threshold to %s (=%d)",};
- _gras_log_event_log(&_log_ev, cat->name,
- gras_log_priority_names[cat->threshold], cat->threshold);
+ {cat,gras_log_priority_verbose,__FILE__,__FUNCTION__,__LINE__};
+ _gras_log_event_log(&_log_ev,
+ "Apply settings for category '%s': set threshold to %s (=%d)",
+ cat->name,
+ gras_log_priority_names[cat->threshold], cat->threshold);
}
}
}
if (!found && cat->threshold <= gras_log_priority_verbose) {
gras_log_event_t _log_ev =
- {cat,gras_log_priority_verbose,__FILE__,__FUNCTION__,__LINE__,
- "Category '%s': inherited threshold = %s (=%d)",};
- _gras_log_event_log(&_log_ev, cat->name,
+ {cat,gras_log_priority_verbose,__FILE__,__FUNCTION__,__LINE__};
+ _gras_log_event_log(&_log_ev,
+ "Category '%s': inherited threshold = %s (=%d)",
+ cat->name,
gras_log_priority_names[cat->threshold], cat->threshold);
}
}
-void _gras_log_event_log( gras_log_event_t* ev, ...) {
+void _gras_log_event_log( gras_log_event_t* ev, const char *fmt, ...) {
gras_log_category_t* cat = ev->cat;
- va_start(ev->ap, ev);
+ va_start(ev->ap, fmt);
while(1) {
gras_log_appender_t* appender = cat->appender;
if (appender != NULL) {
- appender->do_append(appender, ev);
+ appender->do_append(appender, ev, fmt);
}
if (!cat->willLogToParent)
break;
}
DEBUG1("New priority name = %s",neweq);
- for (i=0; i<6; i++) {
+ for (i=0; i<gras_log_priority_infinite-1; i++) {
if (!strncmp(gras_log_priority_names[i],neweq,p-eq)) {
DEBUG1("This is priority %d",i);
break;
}
}
- if (i<6) {
+ if (i<gras_log_priority_infinite-1) {
set->thresh=i;
} else {
gras_assert1(FALSE,"Unknown priority name: %s",eq+1);