gremlin/src/client/main.cpp

42 lines
972 B
C++
Raw Normal View History

2011-07-04 11:56:19 +02:00
#include <log4cplus/logger.h>
#include <log4cplus/configurator.h>
2011-01-14 14:59:18 +01:00
#include "Client.h"
2011-01-04 18:11:59 +01:00
2011-01-14 14:59:18 +01:00
#include <iostream>
2011-01-04 18:11:59 +01:00
2011-01-16 23:02:40 +01:00
int main(int argc, const char **argv) {
2011-07-04 11:56:19 +02:00
log4cplus::BasicConfigurator basicConfig;
basicConfig.configure();
log4cplus::PropertyConfigurator propConfig("logging.cfg");
propConfig.configure();
log4cplus::Logger logger = log4cplus::Logger::getInstance("main");
LOG4CPLUS_INFO(logger, "starting gremlin");
LOG4CPLUS_INFO(logger, "arguments (" << argc << "):");
for (size_t i = 0; i < argc; i++)
LOG4CPLUS_INFO(logger, " - " << argv[i]);
2011-01-14 14:59:18 +01:00
try {
2018-11-26 13:15:41 +01:00
gln::Client app;
gln::Config config;
config.load(argc, argv);
app.initialize(config);
2011-01-14 14:59:18 +01:00
while (app.isRunning())
app.update();
app.shutdown();
} catch (const char *str) {
std::cerr << "Exception: " << str << std::endl;
return 1;
} catch (const std::exception &e) {
std::cerr << "Exception: " << e.what() << std::endl;
return 1;
}
2011-07-04 11:56:19 +02:00
return 0;
2011-01-04 18:11:59 +01:00
}