diff options
Diffstat (limited to 'common/log.h')
-rw-r--r-- | common/log.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/common/log.h b/common/log.h index 564c574..c643f84 100644 --- a/common/log.h +++ b/common/log.h | |||
@@ -16,15 +16,31 @@ enum DebugLevel { | |||
16 | QByteArray SINKCOMMON_EXPORT debugLevelName(DebugLevel debugLevel); | 16 | QByteArray SINKCOMMON_EXPORT debugLevelName(DebugLevel debugLevel); |
17 | DebugLevel SINKCOMMON_EXPORT debugLevelFromName(const QByteArray &name); | 17 | DebugLevel SINKCOMMON_EXPORT debugLevelFromName(const QByteArray &name); |
18 | 18 | ||
19 | /** | ||
20 | * Sets the debug output level. | ||
21 | * | ||
22 | * Everything below is ignored. | ||
23 | */ | ||
19 | void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel); | 24 | void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel); |
20 | DebugLevel SINKCOMMON_EXPORT debugOutputLevel(); | 25 | DebugLevel SINKCOMMON_EXPORT debugOutputLevel(); |
21 | 26 | ||
27 | /// Set debug areas that should be logged | ||
28 | void SINKCOMMON_EXPORT setAreas(const QByteArrayList &areas); | ||
29 | |||
30 | /** | ||
31 | * Set an application name filter. | ||
32 | * | ||
33 | * Note: In case of resources the identifier is the application name. | ||
34 | */ | ||
35 | void SINKCOMMON_EXPORT setFilter(const QByteArrayList &filter); | ||
36 | |||
37 | |||
22 | QDebug SINKCOMMON_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); | 38 | QDebug SINKCOMMON_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); |
23 | 39 | ||
24 | } | 40 | } |
25 | } | 41 | } |
26 | 42 | ||
27 | #define DEBUG_AREA 0 | 43 | #define DEBUG_AREA nullptr |
28 | 44 | ||
29 | #define Trace_() Sink::Log::debugStream(Sink::Log::DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO) | 45 | #define Trace_() Sink::Log::debugStream(Sink::Log::DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO) |
30 | #define Log_() Sink::Log::debugStream(Sink::Log::DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO) | 46 | #define Log_() Sink::Log::debugStream(Sink::Log::DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO) |