NJ_LOGGER_XML is a C++ class developed to make your system able to generate an XML log file.
This is usefull to debug and trace the host program's routines, make execution statistics, allocation/deallocation checks.
Once added to the project, the class is ready to use (it doesn't need for an explicit allocation) and initializes itself using a text configuration file specified in the constructor's invocation.
The text file contains information about the project name, version, author, xml output version and encoding.
NJ_LOGGER_XML exposes some methods invocable from the source files that includes the header NJ_LOGGER_XML.h and specify the namespace NinjaCross.
These ellipse methods are:
messaggio -> inserts in the log an arbitrary message with related arguments
errore -> inserts in the log an ERROR message with related arguments
evento -> inserts in the log an EVENT message with related arguments
costruttore -> inserts in the log an ALLOCATION message keeping track of the number of invocations
distruttore -> inserts in the log a DEALLOCATION message keeping track of the number of invocations
In the end of the file, the class generates a report with the number of allocations, deallocations, and their count gap, the number of errors, events and total invocations. The names of the xml tags are in italian, but the source code is pretty simple to modify in any language.
Attached to the zip file of the download there is a sample configuration file, an xml output and an XSLT transormation style sheet that you can use to generate a printer friendly HTML version (also contained in the zip).