diff options
Diffstat (limited to 'akonadi2_cli')
-rw-r--r-- | akonadi2_cli/state.cpp | 13 | ||||
-rw-r--r-- | akonadi2_cli/state.h | 4 |
2 files changed, 17 insertions, 0 deletions
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) | |||
47 | { | 47 | { |
48 | printLine("ERROR" + (errorCode.isEmpty() ? "" : " " + errorCode) + ": " + errorMessage); | 48 | printLine("ERROR" + (errorCode.isEmpty() ? "" : " " + errorCode) + ": " + errorMessage); |
49 | } | 49 | } |
50 | |||
51 | void State::setDebugLevel(unsigned int level) | ||
52 | { | ||
53 | if (level < 7) { | ||
54 | m_debugLevel = level; | ||
55 | } | ||
56 | } | ||
57 | |||
58 | unsigned int State::debugLevel() const | ||
59 | { | ||
60 | return m_debugLevel; | ||
61 | } | ||
62 | |||
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: | |||
30 | void printLine(const QString &message = QString(), unsigned int indentationLevel = 0); | 30 | void printLine(const QString &message = QString(), unsigned int indentationLevel = 0); |
31 | void printError(const QString &errorMessage, const QString &errorCode = QString()); | 31 | void printError(const QString &errorMessage, const QString &errorCode = QString()); |
32 | 32 | ||
33 | void setDebugLevel(unsigned int level); | ||
34 | unsigned int debugLevel() const; | ||
35 | |||
33 | private: | 36 | private: |
37 | int m_debugLevel = 0; | ||
34 | QTextStream m_outStream; | 38 | QTextStream m_outStream; |
35 | }; | 39 | }; |
36 | 40 | ||