diff options
Diffstat (limited to 'common/log.h')
-rw-r--r-- | common/log.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/common/log.h b/common/log.h index 415c7f7..0e92ea9 100644 --- a/common/log.h +++ b/common/log.h | |||
@@ -6,7 +6,8 @@ | |||
6 | namespace Sink { | 6 | namespace Sink { |
7 | namespace Log { | 7 | namespace Log { |
8 | 8 | ||
9 | enum DebugLevel { | 9 | enum DebugLevel |
10 | { | ||
10 | Trace, | 11 | Trace, |
11 | Log, | 12 | Log, |
12 | Warning, | 13 | Warning, |
@@ -24,14 +25,15 @@ DebugLevel SINK_EXPORT debugLevelFromName(const QByteArray &name); | |||
24 | void SINK_EXPORT setDebugOutputLevel(DebugLevel); | 25 | void SINK_EXPORT setDebugOutputLevel(DebugLevel); |
25 | DebugLevel SINK_EXPORT debugOutputLevel(); | 26 | DebugLevel SINK_EXPORT debugOutputLevel(); |
26 | 27 | ||
27 | enum FilterType { | 28 | enum FilterType |
29 | { | ||
28 | Area, | 30 | Area, |
29 | ApplicationName | 31 | ApplicationName |
30 | }; | 32 | }; |
31 | 33 | ||
32 | /** | 34 | /** |
33 | * Sets a debug output filter. | 35 | * Sets a debug output filter. |
34 | * | 36 | * |
35 | * Everything that is not matching the filter is ignored. | 37 | * Everything that is not matching the filter is ignored. |
36 | * An empty filter matches everything. | 38 | * An empty filter matches everything. |
37 | * | 39 | * |
@@ -53,7 +55,7 @@ QByteArrayList SINK_EXPORT debugOutputFilter(FilterType type); | |||
53 | void SINK_EXPORT setDebugOutputFields(const QByteArrayList &filter); | 55 | void SINK_EXPORT setDebugOutputFields(const QByteArrayList &filter); |
54 | QByteArrayList SINK_EXPORT debugOutputFields(); | 56 | QByteArrayList SINK_EXPORT debugOutputFields(); |
55 | 57 | ||
56 | QDebug SINK_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); | 58 | QDebug SINK_EXPORT debugStream(DebugLevel debugLevel, int line, const char *file, const char *function, const char *debugArea = 0); |
57 | 59 | ||
58 | struct SINK_EXPORT TraceTime | 60 | struct SINK_EXPORT TraceTime |
59 | { | 61 | { |
@@ -66,7 +68,6 @@ inline QDebug SINK_EXPORT operator<<(QDebug d, const TraceTime &time) | |||
66 | d << time.time << "[ms]"; | 68 | d << time.time << "[ms]"; |
67 | return d; | 69 | return d; |
68 | } | 70 | } |
69 | |||
70 | } | 71 | } |
71 | } | 72 | } |
72 | 73 | ||
@@ -83,5 +84,5 @@ inline QDebug SINK_EXPORT operator<<(QDebug d, const TraceTime &time) | |||
83 | #define Trace() Sink::Log::debugStream(Sink::Log::DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) | 84 | #define Trace() Sink::Log::debugStream(Sink::Log::DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) |
84 | #define Log() Sink::Log::debugStream(Sink::Log::DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) | 85 | #define Log() Sink::Log::debugStream(Sink::Log::DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) |
85 | #define Warning() Sink::Log::debugStream(Sink::Log::DebugLevel::Warning, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) | 86 | #define Warning() Sink::Log::debugStream(Sink::Log::DebugLevel::Warning, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) |
86 | //FIXME Error clashes with Storage::Error and MessageQueue::Error | 87 | // FIXME Error clashes with Storage::Error and MessageQueue::Error |
87 | #define ErrorMsg() Sink::Log::debugStream(Sink::Log::DebugLevel::Error, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) | 88 | #define ErrorMsg() Sink::Log::debugStream(Sink::Log::DebugLevel::Error, __LINE__, __FILE__, Q_FUNC_INFO, DEBUG_AREA) |