diff options
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) | ||