summaryrefslogtreecommitdiffstats
path: root/common/log.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-04 18:39:18 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-04 18:39:18 +0100
commit8599c4d371139dc0d4444b128792cd499129d349 (patch)
tree79376b7fb2496d20265ec245d93964965b0103c4 /common/log.h
parentafa7c80114a327d85ee6c99b9d3d811107d9e204 (diff)
downloadsink-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.h18
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 {
16QByteArray SINKCOMMON_EXPORT debugLevelName(DebugLevel debugLevel); 16QByteArray SINKCOMMON_EXPORT debugLevelName(DebugLevel debugLevel);
17DebugLevel SINKCOMMON_EXPORT debugLevelFromName(const QByteArray &name); 17DebugLevel SINKCOMMON_EXPORT debugLevelFromName(const QByteArray &name);
18 18
19/**
20 * Sets the debug output level.
21 *
22 * Everything below is ignored.
23 */
19void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel); 24void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel);
20DebugLevel SINKCOMMON_EXPORT debugOutputLevel(); 25DebugLevel SINKCOMMON_EXPORT debugOutputLevel();
21 26
27/// Set debug areas that should be logged
28void 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 */
35void SINKCOMMON_EXPORT setFilter(const QByteArrayList &filter);
36
37
22QDebug SINKCOMMON_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); 38QDebug 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)