diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-26 09:44:00 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-03-31 11:11:08 +0200 |
commit | c9aeb8896ae578515c217b9a08988156b4d62f1e (patch) | |
tree | 4735d7df7c16ee9556f80aba61a034ff48f1196a /common/log.h | |
parent | 8f2fed8d2a1b23a8f318047b6592ad64b6ecbd22 (diff) | |
download | sink-c9aeb8896ae578515c217b9a08988156b4d62f1e.tar.gz sink-c9aeb8896ae578515c217b9a08988156b4d62f1e.zip |
Resource crashhandler and logging facilities.
Diffstat (limited to 'common/log.h')
-rw-r--r-- | common/log.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/log.h b/common/log.h new file mode 100644 index 0000000..8d3dc75 --- /dev/null +++ b/common/log.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <QDebug> | ||
4 | |||
5 | enum DebugLevel { | ||
6 | Trace, | ||
7 | Log, | ||
8 | Warning, | ||
9 | Error | ||
10 | }; | ||
11 | |||
12 | QDebug debugStream(DebugLevel debugLevel, int line, const char* file, const char* function); | ||
13 | |||
14 | #define Trace() debugStream(DebugLevel::Trace, __LINE__, __FILE__, Q_FUNC_INFO) | ||
15 | #define Log() debugStream(DebugLevel::Log, __LINE__, __FILE__, Q_FUNC_INFO) | ||
16 | #define Warning() debugStream(DebugLevel::Warning, __LINE__, __FILE__, Q_FUNC_INFO) | ||
17 | #define Error() debugStream(DebugLevel::Error, __LINE__, __FILE__, Q_FUNC_INFO) | ||