diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-11 11:44:04 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-11 11:44:04 +0100 |
commit | d2d87b5d0d57aaeb46d2058a28749c2463a86a77 (patch) | |
tree | 828ad131eea140407843f6ad7f207823de62e1b7 /akonadish/state.cpp | |
parent | b1a66bc9b66213d1d4852553e7180dcc76fb6bf7 (diff) | |
parent | b59a7fe545aa2732e98ecc373c4ab5ca741cd920 (diff) | |
download | sink-d2d87b5d0d57aaeb46d2058a28749c2463a86a77.tar.gz sink-d2d87b5d0d57aaeb46d2058a28749c2463a86a77.zip |
Merge branch 'feature/akonadish_log_control' into develop
Diffstat (limited to 'akonadish/state.cpp')
-rw-r--r-- | akonadish/state.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/akonadish/state.cpp b/akonadish/state.cpp index 85cbe10..9fb5bcc 100644 --- a/akonadish/state.cpp +++ b/akonadish/state.cpp | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <QEventLoop> | 24 | #include <QEventLoop> |
25 | #include <QTextStream> | 25 | #include <QTextStream> |
26 | 26 | ||
27 | #include "common/log.h" | ||
28 | |||
27 | static bool s_hasEventLoop = false; | 29 | static bool s_hasEventLoop = false; |
28 | 30 | ||
29 | class State::Private | 31 | class State::Private |
@@ -127,4 +129,16 @@ bool State::commandTiming() const | |||
127 | return d->timing; | 129 | return d->timing; |
128 | } | 130 | } |
129 | 131 | ||
132 | void State::setLoggingLevel(const QString &level) const | ||
133 | { | ||
134 | Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::debugLevelFromName(level.toLatin1())); | ||
135 | } | ||
136 | |||
137 | QString State::loggingLevel() const | ||
138 | { | ||
139 | // do not turn this into a single line return: that core dumps due to allocation of | ||
140 | // the byte array in Akonadi2::Log | ||
141 | QByteArray rv = Akonadi2::Log::debugLevelName(Akonadi2::Log::debugOutputLevel()); | ||
142 | return rv.toLower(); | ||
143 | } | ||
130 | 144 | ||