/* file_appender - a dumb log appender which simply prints to stdout */
-/* Copyright (c) 2004 Martin Quinson. All rights reserved. */
+/* Copyright (c) 2003, 2004 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. */
/* TODO: define a format field in struct for timestamp, etc.
struct DefaultLogAppender* this = (struct DefaultLogAppender*)this0;*/
-
+
+ char *procname = (char*)xbt_procname();
+ if (!procname)
+ procname = (char*)"";
+
if ((FILE*)(this->appender_data) == NULL)
this->appender_data = (void*)stderr;
"Priority %d is greater than the biggest allowed value",
ev->priority);
- fprintf(stderr, "%s:%d: ", ev->fileName, ev->lineNum);
+ fprintf(stderr, "[%s] %s:%d: ", procname, ev->fileName, ev->lineNum);
fprintf(stderr, "[%s/%s] ",
- ev->cat->name, xbt_log_priority_names[ev->priority]);
+ ev->cat->name, xbt_log_priority_names[ev->priority] );
vfprintf(stderr, fmt, ev->ap);
fprintf(stderr, "\n");
}