This is an example of logging in static initialization code and using the current module name (auto-configured) to select the Log4cxx configuration file. In this example Log4cxx is configured by loading auto-configured.xml. The function com::foo::getLogger()
, which is called during initialization, is implemented in the com/foo/config4.cpp file.
#include "com/foo/config.h"
auto rootLogger = com::foo::getLogger();
struct ExampleStaticData {
ExampleStaticData() {
}
} static_object;
int main() {
return EXIT_SUCCESS;
}
#define LOG4CXX_INFO(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for INFO even...
Definition log4cxx/logger.h:2318
#define LOG4CXX_DEBUG(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for DEBUG eve...
Definition log4cxx/logger.h:2232