diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-04 18:39:18 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-04 18:39:18 +0100 |
commit | 8599c4d371139dc0d4444b128792cd499129d349 (patch) | |
tree | 79376b7fb2496d20265ec245d93964965b0103c4 /common/log.h | |
parent | afa7c80114a327d85ee6c99b9d3d811107d9e204 (diff) | |
download | sink-8599c4d371139dc0d4444b128792cd499129d349.tar.gz sink-8599c4d371139dc0d4444b128792cd499129d349.zip |
Filter debug output by program name and area
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) |