summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2014-12-23 19:03:24 +0100
committerTomasz Sterna <tomek@xiaoka.com>2014-12-23 19:03:24 +0100
commitb8e1aa9dbc0ce9e40912445e1860c44f372cccb2 (patch)
tree46c1af920256b4ef4240e08d5688e901e345b980
parentdb6f5a5c1f492648cfab608550a1f0e484bdb582 (diff)
Implemented daemon -d debug logging switch
-rw-r--r--daemon/daemon.cpp8
1 files 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;