summaryrefslogtreecommitdiffstats
path: root/src/fbgui
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-12-06 15:17:44 +0100
committerSebastian Schmelzer2011-12-06 15:17:44 +0100
commitbb0613f640eb8cb27079767b367b2803a99a7505 (patch)
treedd77654da3d51e680edd0457b97da5959adb8105 /src/fbgui
parentupdate logging (diff)
downloadfbgui-bb0613f640eb8cb27079767b367b2803a99a7505.tar.gz
fbgui-bb0613f640eb8cb27079767b367b2803a99a7505.tar.xz
fbgui-bb0613f640eb8cb27079767b367b2803a99a7505.zip
update logging
Diffstat (limited to 'src/fbgui')
-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");