Exemple #1
0
int main(int argc, char *argv[])
{
	CMain mw;
	if (argc > 0)
		mw.init(argv[1]);
	else
		mw.init(nullptr);
}
int main(int argc, char* argv[])
{
	try {
	
#ifdef _DEBUG
		CLog::getInstance().setConsoleLevel(DEBUG);
#else
		CLog::getInstance().setConsoleLevel(WARN);
#endif
		CLog::getInstance().setFileLevel(WARN);
		CLog::getInstance().setLogSourceFileAll(false);
		CLog::getInstance().setLogSourceFile(ERROR, true);
		
		Exception::setLogAllExceptions(true);
		
		
		CMain main;
		main.init(argc, argv);
		main.exec();
	} catch (pugi::xpath_exception& e) {
		printf("XML parsing exception: %s\n", e.what());
		return -1;
	} catch (Exception& e) {
		e.log();
		return -1;
	}
	return 0;
}