diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-05 11:59:30 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-05 11:59:30 +0100 |
commit | e1716e503d96d4c8331fb1dc2e701f2b6df240ec (patch) | |
tree | a35d3ee0d4c81c785d04878dda6eca3b61daf1bc /common/log.h | |
parent | e903e47cb0aada785e758264168d99bc4d0ad029 (diff) | |
download | sink-e1716e503d96d4c8331fb1dc2e701f2b6df240ec.tar.gz sink-e1716e503d96d4c8331fb1dc2e701f2b6df240ec.zip |
Logging cleanup
Diffstat (limited to 'common/log.h')
-rw-r--r-- | common/log.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/common/log.h b/common/log.h index 8a6c295..92d6cdd 100644 --- a/common/log.h +++ b/common/log.h | |||
@@ -24,25 +24,32 @@ DebugLevel SINKCOMMON_EXPORT debugLevelFromName(const QByteArray &name); | |||
24 | void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel); | 24 | void SINKCOMMON_EXPORT setDebugOutputLevel(DebugLevel); |
25 | DebugLevel SINKCOMMON_EXPORT debugOutputLevel(); | 25 | DebugLevel SINKCOMMON_EXPORT debugOutputLevel(); |
26 | 26 | ||
27 | /// Set debug areas that should be logged | 27 | enum FilterType { |
28 | void SINKCOMMON_EXPORT setAreas(const QByteArrayList &areas); | 28 | Area, |
29 | ApplicationName | ||
30 | }; | ||
29 | 31 | ||
30 | /** | 32 | /** |
31 | * Set an application name filter. | 33 | * Sets a debug output filter. |
34 | * | ||
35 | * Everything that is not matching the filter is ignored. | ||
36 | * An empty filter matches everything. | ||
32 | * | 37 | * |
33 | * Note: In case of resources the identifier is the application name. | 38 | * Note: In case of resources the application name is the identifier. |
34 | */ | 39 | */ |
35 | void SINKCOMMON_EXPORT setFilter(const QByteArrayList &filter); | 40 | void SINKCOMMON_EXPORT setDebugOutputFilter(FilterType, const QByteArrayList &filter); |
36 | 41 | ||
37 | /** | 42 | /** |
38 | * Set an application debug output. | 43 | * Set the debug output fields. |
39 | * | 44 | * |
40 | * Currently supported are: | 45 | * Currently supported are: |
41 | * * Name: Application name used for filter. | 46 | * * Name: Application name used for filter. |
42 | * * Function: The function name: | 47 | * * Function: The function name: |
43 | * * Location: The source code location. | 48 | * * Location: The source code location. |
49 | * | ||
50 | * These are additional items to the default ones (level, area, message). | ||
44 | */ | 51 | */ |
45 | void SINKCOMMON_EXPORT setDebugOutput(const QByteArrayList &filter); | 52 | void SINKCOMMON_EXPORT setDebugOutputFields(const QByteArrayList &filter); |
46 | 53 | ||
47 | QDebug SINKCOMMON_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); | 54 | QDebug SINKCOMMON_EXPORT debugStream(DebugLevel debugLevel, int line, const char* file, const char* function, const char* debugArea = 0); |
48 | 55 | ||