diff options
Diffstat (limited to 'common/log.h')
-rw-r--r-- | common/log.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/common/log.h b/common/log.h index ee92f46..9db9e8e 100644 --- a/common/log.h +++ b/common/log.h | |||
@@ -2,6 +2,9 @@ | |||
2 | 2 | ||
3 | #include <QDebug> | 3 | #include <QDebug> |
4 | 4 | ||
5 | namespace Akonadi2 { | ||
6 | namespace Log { | ||
7 | |||
5 | enum DebugLevel { | 8 | enum DebugLevel { |
6 | Trace, | 9 | Trace, |
7 | Log, | 10 | Log, |
@@ -9,10 +12,15 @@ enum DebugLevel { | |||
9 | Error | 12 | Error |
10 | }; | 13 | }; |
11 | 14 | ||
15 | void setDebugOutputLevel(DebugLevel); | ||
16 | |||
12 | QDebug debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); | 17 | QDebug debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); |
13 | 18 | ||
14 | #define Trace() debugStream(DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO) | 19 | } |
15 | #define Log() debugStream(DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO) | 20 | } |
16 | #define Warning() debugStream(DebugLevel::Warning, __LINE__, __FILE__, Q_FUNC_INFO) | 21 | |
22 | #define Trace() Akonadi2::Log::debugStream(Akonadi2::Log::DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO) | ||
23 | #define Log() Akonadi2::Log::debugStream(Akonadi2::Log::DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO) | ||
24 | #define Warning() Akonadi2::Log::debugStream(Akonadi2::Log::DebugLevel::Warning, __LINE__, __FILE__, Q_FUNC_INFO) | ||
17 | //FIXME Error clashes with Storage::Error and MessageQueue::Error | 25 | //FIXME Error clashes with Storage::Error and MessageQueue::Error |
18 | #define ErrorMsg() debugStream(DebugLevel::Error, __LINE__, __FILE__, Q_FUNC_INFO) | 26 | #define ErrorMsg() Akonadi2::Log::debugStream(Akonadi2::Log::DebugLevel::Error, __LINE__, __FILE__, Q_FUNC_INFO) |