From b8e1aa9dbc0ce9e40912445e1860c44f372cccb2 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Tue, 23 Dec 2014 19:03:24 +0100 Subject: Implemented daemon -d debug logging switch --- daemon/daemon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp index 69bcbe6..e4306da 100644 --- a/daemon/daemon.cpp +++ b/daemon/daemon.cpp @@ -52,9 +52,13 @@ int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); + QStringList filterRules; + + filterRules << (argc > 1 and QString("-d") == argv[0] ? + "*.debug=false" : "*.debug=true"); + // Init logging should be called after app object creation - QLoggingCategory::setFilterRules("*.debug=false\n" - "fc.io.debug=true"); + QLoggingCategory::setFilterRules(filterRules.join("\n")); QLoggingCategory l("main"); qCDebug(l) << argv[0] << APP_VERSION; -- cgit v1.2.3