summaryrefslogtreecommitdiffstats
path: root/common/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/log.h')
-rw-r--r--common/log.h13
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 @@
6namespace Sink { 6namespace Sink {
7namespace Log { 7namespace Log {
8 8
9enum DebugLevel { 9enum 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);
24void SINK_EXPORT setDebugOutputLevel(DebugLevel); 25void SINK_EXPORT setDebugOutputLevel(DebugLevel);
25DebugLevel SINK_EXPORT debugOutputLevel(); 26DebugLevel SINK_EXPORT debugOutputLevel();
26 27
27enum FilterType { 28enum 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);
53void SINK_EXPORT setDebugOutputFields(const QByteArrayList &filter); 55void SINK_EXPORT setDebugOutputFields(const QByteArrayList &filter);
54QByteArrayList SINK_EXPORT debugOutputFields(); 56QByteArrayList SINK_EXPORT debugOutputFields();
55 57
56QDebug SINK_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); 58QDebug SINK_EXPORT debugStream(DebugLevel debugLevel, int line, const char *file, const char *function, const char *debugArea = 0);
57 59
58struct SINK_EXPORT TraceTime 60struct 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)