|
|
@ -24,26 +24,44 @@ |
|
|
|
#include "src/utility/settings.h"
|
|
|
|
#include "Eigen/Sparse"
|
|
|
|
|
|
|
|
#include <log4cplus/logger.h>
|
|
|
|
#include <log4cplus/loggingmacros.h>
|
|
|
|
#include <log4cplus/configurator.h>
|
|
|
|
#include "log4cplus/logger.h"
|
|
|
|
#include "log4cplus/loggingmacros.h"
|
|
|
|
#include "log4cplus/consoleappender.h"
|
|
|
|
#include "log4cplus/fileappender.h"
|
|
|
|
|
|
|
|
#include "src/exceptions/InvalidSettings.h"
|
|
|
|
|
|
|
|
log4cplus::Logger logger; |
|
|
|
|
|
|
|
/*!
|
|
|
|
* Initializes the logging framework. |
|
|
|
*/ |
|
|
|
void setUpLogging() { |
|
|
|
log4cplus::SharedAppenderPtr fileLogAppender(new log4cplus::FileAppender("mrmc.log")); |
|
|
|
fileLogAppender->setName("mainFileAppender"); |
|
|
|
fileLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M:%s} (%r ms) - %F:%L : %m%n"))); |
|
|
|
logger = log4cplus::Logger::getInstance("mainLogger"); |
|
|
|
logger.addAppender(fileLogAppender); |
|
|
|
|
|
|
|
// Uncomment these lines to enable console logging output
|
|
|
|
// log4cplus::SharedAppenderPtr consoleLogAppender(new log4cplus::ConsoleAppender());
|
|
|
|
// consoleLogAppender->setName("mainConsoleAppender");
|
|
|
|
// consoleLogAppender->setLayout(std::auto_ptr<log4cplus::Layout>(new log4cplus::PatternLayout("%-5p - %D{%H:%M:%s} (%r ms) - %F:%L : %m%n")));
|
|
|
|
// logger.addAppender(consoleLogAppender);
|
|
|
|
} |
|
|
|
|
|
|
|
int main(const int argc, const char* argv[]) { |
|
|
|
setUpLogging(); |
|
|
|
|
|
|
|
mrmc::settings::Settings* s = NULL; |
|
|
|
log4cplus::BasicConfigurator loggingConfig; |
|
|
|
loggingConfig.configure(); |
|
|
|
log4cplus::Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main")); |
|
|
|
|
|
|
|
LOG4CPLUS_INFO(logger, "This is the Markov Reward Model Checker (MRMC) by i2 of RWTH Aachen university."); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
try { |
|
|
|
s = new mrmc::settings::Settings(argc, argv, nullptr); |
|
|
|
} |
|
|
|
catch (mrmc::exceptions::InvalidSettings&) |
|
|
|
{ |
|
|
|
std::cout << "Could not recover from settings error, terminating." << std::endl; |
|
|
|
catch (mrmc::exceptions::InvalidSettings&) { |
|
|
|
LOG4CPLUS_FATAL(logger, "Could not recover from settings error, terminating."); |
|
|
|
delete s; |
|
|
|
return 1; |
|
|
|
} |
|
|
@ -69,6 +87,8 @@ int main(const int argc, const char* argv[]) { |
|
|
|
delete s; |
|
|
|
} |
|
|
|
|
|
|
|
LOG4CPLUS_INFO(logger, "Nothing more to do, exiting."); |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|