[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [akonadi-next/feature/akonadish_log_control] akonadish: add logging level management to State
From: Aaron Seigo <aseigo () kde ! org>
Date: 2016-01-10 10:25:50
Message-ID: E1aIDC2-0002IK-6M () scm ! kde ! org
[Download RAW message or body]
Git commit 2760d5944802f24321ed98083e9f15a484197f7b by Aaron Seigo.
Committed on 10/01/2016 at 10:20.
Pushed by aseigo into branch 'feature/akonadish_log_control'.
add logging level management to State
M +14 -0 akonadish/state.cpp
M +3 -0 akonadish/state.h
http://commits.kde.org/akonadi-next/2760d5944802f24321ed98083e9f15a484197f7b
diff --git a/akonadish/state.cpp b/akonadish/state.cpp
index f3f5975..dbd5952 100644
--- a/akonadish/state.cpp
+++ b/akonadish/state.cpp
@@ -24,6 +24,8 @@
#include <QEventLoop>
#include <QTextStream>
+#include "common/log.h"
+
static bool s_hasEventLoop = false;
class State::Private
@@ -122,4 +124,16 @@ bool State::commandTiming() const
return d->timing;
}
+void State::setLoggingLevel(const QString &level) const
+{
+ Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::debugLevelFromName(level.toLatin1()));
+}
+
+QString State::loggingLevel() const
+{
+ // do not turn this into a single line return: that core dumps due to allocation of
+ // the byte array in Akonadi2::Log
+ QByteArray rv = Akonadi2::Log::debugLevelName(Akonadi2::Log::debugOutputLevel());
+ return rv.toLower();
+}
diff --git a/akonadish/state.h b/akonadish/state.h
index 9c1ab6f..543b063 100644
--- a/akonadish/state.h
+++ b/akonadish/state.h
@@ -39,6 +39,9 @@ public:
int commandStarted() const;
void commandFinished(int returnCode = 0) const;
+ void setLoggingLevel(const QString &level) const;
+ QString loggingLevel() const;
+
static void setHasEventLoop(bool evented);
private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic