diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2014-12-23 19:03:24 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2014-12-23 19:03:24 +0100 |
| commit | b8e1aa9dbc0ce9e40912445e1860c44f372cccb2 (patch) | |
| tree | 46c1af920256b4ef4240e08d5688e901e345b980 /daemon/daemon.cpp | |
| parent | db6f5a5c1f492648cfab608550a1f0e484bdb582 (diff) | |
Implemented daemon -d debug logging switch
Diffstat (limited to 'daemon/daemon.cpp')
| -rw-r--r-- | daemon/daemon.cpp | 8 |
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; |
