summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-25 23:27:48 +0100
committerJonathan Bauer2011-03-25 23:27:48 +0100
commitac5d4a4dfdd417d6344e8ede262204a78f73e433 (patch)
tree0b77fa806947474409fa940d08f1fc8ee5bc962d /src/main.cpp
parentfixes (diff)
downloadfbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.tar.gz
fbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.tar.xz
fbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.zip
improvements
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 178d3e3..b9643c1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,6 +4,7 @@
#include <getopt.h>
#include <cstdlib>
#include <iostream>
+#include "loggerengine.h"
#include "fbgui.h"
void printHelp()
@@ -80,8 +81,16 @@ int main(int argc, char *argv[])
if (clOpts.contains("help"))
printHelp();
- if (clOpts.contains("debug"))
+ if (clOpts.contains("debug")){
debugMode = clOpts.value("debug").toInt();
+ // start basic debug log
+ qxtLog->disableLoggerEngine("DEFAULT");
+ qxtLog->addLoggerEngine("std_logger", new LoggerEngine_std);
+ qxtLog->initLoggerEngine("std_logger");
+ qxtLog->setMinimumLevel("std_logger", QxtLogger::DebugLevel);
+ qxtLog->enableLogLevels(QxtLogger::DebugLevel);
+ qxtLog->debug() << "Initializing fbgui...";
+ }
else
debugMode = -1;
@@ -144,17 +153,14 @@ int main(int argc, char *argv[])
else
serialLocation = QString("/serial"); // tests
- // debug config printing
- QTextStream out(stdout);
- if (debugMode > -1){
- out << "************* CONFIG INFO *************\n";
- out << "configFilePath: " << configFilePath.toUtf8() << endl;
- out << "baseURL: " << baseURL.toString().toUtf8() << endl;
- out << "downloadDir : " << downloadPath.toUtf8() << endl;
- out << "trigger: " << fileToTriggerURL.toUtf8() << endl;
- out << "serialLocation: " << serialLocation.toUtf8() << endl;
- out << "*******************************************\n";
- }
+ // print config
+ qxtLog->debug() << "************* CONFIG INFO *************";
+ qxtLog->debug() << "configFilePath: " << configFilePath.toUtf8();
+ qxtLog->debug() << "baseURL: " << baseURL.toString().toUtf8();
+ qxtLog->debug() << "downloadDir : " << downloadPath.toUtf8();
+ qxtLog->debug() << "trigger: " << fileToTriggerURL.toUtf8();
+ qxtLog->debug() << "serialLocation: " << serialLocation.toUtf8();
+ qxtLog->debug() << "*******************************************";
// start fbgui
fbgui gui;