X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fmain.cxx;h=24ddf7a2ad24aca695601d0d6b8d0906b4a5350e;hp=a627b61dc7a391263adcb6bef67af3e431f5133c;hb=fd85e36ca37c93139dc7bf8d06cf71bc5a225321;hpb=c6e89377cd981f9be1f18a6be334fbcfebb0c16e diff --git a/src/main.cxx b/src/main.cxx index a627b61..24ddf7a 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -33,15 +33,40 @@ int main(int argc, char** argv) QApplication::setApplicationName("frida"); QApplication::setApplicationVersion("0.0"); - QApplication::addLibraryPath(CMAKE_INSTALL_FULL_LIBDIR "/frida/plugins/Interpreter"); + QApplication::addLibraryPath(CONFIG_LIBDIR "/frida/plugins/Interpreter"); #ifdef ARGPARSE parser.addHelpOption(); parser.addVersionOption(); + + QCommandLineOption loglevelOption("loglevel", "Control verbosity of logging", "FATAL|ERROR|WARN|INFO|DEBUG|TRACE"); + loglevelOption.setDefaultValue("INFO"); + parser.addOption(loglevelOption); + parser.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble.")); parser.process(app); #endif + log4cxx::LevelPtr level = log4cxx::Level::getInfo(); +#ifdef ARGPARSE + if (parser.value(loglevelOption) != "") { + std::string levelstring = parser.value(loglevelOption).toStdString(); + if (levelstring == "FATAL") + level = log4cxx::Level::getFatal(); + if (levelstring == "ERROR") + level = log4cxx::Level::getError(); + if (levelstring == "WARN") + level = log4cxx::Level::getWarn(); + if (levelstring == "INFO") + level = log4cxx::Level::getInfo(); + if (levelstring == "DEBUG") + level = log4cxx::Level::getDebug(); + if (levelstring == "TRACE") + level = log4cxx::Level::getTrace(); + } +#endif + log4cxx::Logger::getRootLogger()->setLevel(level); + InformationManager iman; LOG4CXX_DEBUG(_logger, "Initializing LLVM");