From bb0613f640eb8cb27079767b367b2803a99a7505 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Tue, 6 Dec 2011 15:17:44 +0100 Subject: update logging --- src/fbgui/main.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/fbgui') 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 #include +#include +#include #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"); -- cgit v1.2.3-55-g7522