The answer for this actually is in the FAQ file included in the library download. I have a fixed-back-end DLL that has the following header in it and I am able to include the class, function and line number in the log file.
#include <pantheios/pantheios.hpp>
#include <pantheios/frontends/fe.N.h>
//#include <pantheios/frontends/fe.simple.h>
#ifndef PANTHEIOS_INCL_PANTHEIOS_H_TRACE
#define PANTHEIOS_TRACE_PREFIX __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): " __FUNCTION__ ": "
#endif /* PANTHEIOS_INCL_PANTHEIOS_H_TRACE */
#include <pantheios/trace.h>
#include <pantheios/inserters.hpp>
#include <pantheios/backends/bec.file.h> // be.file header
What is happening here is that you have to redefine PANTHEIOS_TRACE_PREFIX before including trace.h, which is what I have shown above. The other lines of code are included simply to show you where the #define goes. And sorry for the delayed response. If you wish I could post a download on my blog with a fixed-back-end DLL project that anyone could use in their solution for simple file-based logging. Leave a comment if you have any interest in that project
Update 2/28/2010 12:53 AM CST: For your reference here is the question from the FAQ:
Q9: "Does Pantheios provide a configuration that yields a logged message
containing the containing function, equivalent to:
log(informational, __FUNCTION__, ": my message");
without having to write that (or some wrapper that checks for compiler support)." [15th March 2008]
A9:
You need to #define PANTHEIOS_TRACE_PREFIX to what you want. By default
it is __FILE__ "(" PANTHEIOS_STRINGIZE(__LINE__) "): "
, which gives the
format <file>(<line>):
To include the function, lets says you want it to have the format <file>(<line>): <func>:
. To achieve this you'd define it as follows:
#include <pantheios/pantheios.h>
#define PANTHEIOS_TRACE_PREFIX __FILE__ " " PANTHEIOS_STRINGIZE(__LINE__) ": " __FUNCTION__ ": "
#include <pantheios/trace.h>
Note that the definition must come before the inclusion of pantheios/trace.h. Therefore, a safer way of doing this is as follows:
/* File: myPantheiosRootHeader.h */
#include <pantheios/pantheios.h>
#ifdef PANTHEIOS_INCL_PANTHEIOS_H_TRACE
# error pantheios/trace.h must not be included before myPantheiosRootHeader.h
#endif /* PANTHEIOS_INCL_PANTHEIOS_H_TRACE */
#define PANTHEIOS_TRACE_PREFIX __FILE__ " " PANTHEIOS_STRINGIZE(__LINE__) ": " __FUNCTION__ ": "
#include <pantheios/trace.h>