summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-08-21 19:36:09 +0200
committerGitHub <noreply@github.com>2023-08-21 19:36:09 +0200
commit37128bfd43a3d86d270c09e34f18fe4df48c6b35 (patch)
treeade4b361562543679b7eaecbe27b5cd0415eef73 /src/debug
parent17d8e4750bd79e0d18b5d0c9f578f23fa47552f4 (diff)
internal: Wayland Protocol impl improvements (#2944)
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/Log.cpp4
-rw-r--r--src/debug/Log.hpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp
index 8c537c3f..4c3a8b2a 100644
--- a/src/debug/Log.cpp
+++ b/src/debug/Log.cpp
@@ -33,6 +33,9 @@ void Debug::log(LogLevel level, const char* fmt, ...) {
if (disableLogs && *disableLogs)
return;
+ if (level == TRACE && !trace)
+ return;
+
// log to a file
std::ofstream ofs;
ofs.open(logFile, std::ios::out | std::ios::app);
@@ -43,6 +46,7 @@ void Debug::log(LogLevel level, const char* fmt, ...) {
case ERR: ofs << "[ERR] "; break;
case CRIT: ofs << "[CRITICAL] "; break;
case INFO: ofs << "[INFO] "; break;
+ case TRACE: ofs << "[TRACE] "; break;
default: break;
}
diff --git a/src/debug/Log.hpp b/src/debug/Log.hpp
index a159a2da..b2d76187 100644
--- a/src/debug/Log.hpp
+++ b/src/debug/Log.hpp
@@ -4,14 +4,14 @@
#define LOGMESSAGESIZE 1024
-enum LogLevel
-{
+enum LogLevel {
NONE = -1,
LOG = 0,
WARN,
ERR,
CRIT,
- INFO
+ INFO,
+ TRACE
};
namespace Debug {
@@ -23,4 +23,5 @@ namespace Debug {
inline int64_t* disableLogs = nullptr;
inline int64_t* disableTime = nullptr;
inline bool disableStdout = false;
+ inline bool trace = false;
}; \ No newline at end of file