summaryrefslogtreecommitdiffstats
path: root/common/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/log.h')
-rw-r--r--common/log.h17
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
5enum DebugLevel {
6 Trace,
7 Log,
8 Warning,
9 Error
10};
11
12QDebug 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)