Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
MyApp-qt.cpp

This file is an example of how to configure Log4cxx in a Qt application.

#include <QCoreApplication>
#include "com/foo/config-qt.h"
#include "com/foo/bar.h"
int main(int argc, char **argv) {
int result = EXIT_SUCCESS;
QCoreApplication app(argc, argv);
com::foo::ConfigureLogging();
try {
auto logger = com::foo::getLogger("MyApp");
LOG4CXX_INFO(logger, QString("Message %1").arg(1));
com::foo::Bar bar;
bar.doIt();
LOG4CXX_INFO(logger, QString("Message %1").arg(2));
}
catch(std::exception&) {
result = EXIT_FAILURE;
}
return result;
}
#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:2161