summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fbgui/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fbgui/main.cpp b/src/fbgui/main.cpp
index d733b43..e8b65f9 100644
--- a/src/fbgui/main.cpp
+++ b/src/fbgui/main.cpp
@@ -6,6 +6,8 @@
#include <iostream>
#include <log4cxx/logger.h>
+#include <log4cxx/basicconfigurator.h>
+#include <log4cxx/propertyconfigurator.h>
#include "qlog4cxx.h"
#include "fbgui.h"
@@ -43,6 +45,29 @@ int main(int argc, char *argv[]) {
// The third parameter sets the application as the
// GUI-Server (aswell as the GUI-Client).
+ QFileInfo loggingConfInfo = QFileInfo(QDir::home(), ".fbgui.logging.conf");
+ QString loggingConfigFilePath;
+ if (loggingConfInfo.exists())
+ loggingConfigFilePath = loggingConfInfo.absoluteFilePath();
+ else {
+ loggingConfInfo = QFileInfo(QString("/etc/fbgui.logging.conf"));
+ if (loggingConfInfo.exists())
+ loggingConfigFilePath = loggingConfInfo.absoluteFilePath();
+ else
+ loggingConfigFilePath = "";
+ }
+
+
+ if (loggingConfigFilePath.length() > 0)
+ {
+ // BasicConfigurator replaced with PropertyConfigurator.
+ PropertyConfigurator::configure(loggingConfigFilePath.toStdString());
+ }
+ else
+ {
+ BasicConfigurator::configure();
+ }
+
QApplication app(argc, argv, QApplication::GuiServer);
app.setOrganizationName("team_projekt_2011");
app.setApplicationName("prebootGUI");