From 72f52fb148380feb018faa9a94a8ad54bb93635f Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 23 Dec 2015 17:02:56 +0100 Subject: debug level --- akonadi2_cli/state.cpp | 13 +++++++++++++ akonadi2_cli/state.h | 4 ++++ 2 files changed, 17 insertions(+) (limited to 'akonadi2_cli') diff --git a/akonadi2_cli/state.cpp b/akonadi2_cli/state.cpp index 9beba7e..08934a8 100644 --- a/akonadi2_cli/state.cpp +++ b/akonadi2_cli/state.cpp @@ -47,3 +47,16 @@ void State::printError(const QString &errorMessage, const QString &errorCode) { printLine("ERROR" + (errorCode.isEmpty() ? "" : " " + errorCode) + ": " + errorMessage); } + +void State::setDebugLevel(unsigned int level) +{ + if (level < 7) { + m_debugLevel = level; + } +} + +unsigned int State::debugLevel() const +{ + return m_debugLevel; +} + diff --git a/akonadi2_cli/state.h b/akonadi2_cli/state.h index a343e51..2f13166 100644 --- a/akonadi2_cli/state.h +++ b/akonadi2_cli/state.h @@ -30,7 +30,11 @@ public: void printLine(const QString &message = QString(), unsigned int indentationLevel = 0); void printError(const QString &errorMessage, const QString &errorCode = QString()); + void setDebugLevel(unsigned int level); + unsigned int debugLevel() const; + private: + int m_debugLevel = 0; QTextStream m_outStream; }; -- cgit v1.2.3