From 868e0f48d023714a205acf071594983d22d1478c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 1 Jul 2022 15:57:56 +0200 Subject: added debug:disable_logs --- src/debug/Log.cpp | 3 +++ src/debug/Log.hpp | 1 + 2 files changed, 4 insertions(+) (limited to 'src/debug') diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index a864f0d2..2fa4a127 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -14,6 +14,9 @@ void Debug::init(std::string IS) { void Debug::log(LogLevel level, const char* fmt, ...) { + if (disableLogs && *disableLogs) + return; + // log to a file std::ofstream ofs; ofs.open(logFile, std::ios::out | std::ios::app); diff --git a/src/debug/Log.hpp b/src/debug/Log.hpp index 814da421..bde9b820 100644 --- a/src/debug/Log.hpp +++ b/src/debug/Log.hpp @@ -17,4 +17,5 @@ namespace Debug { void log(LogLevel level, const char* fmt, ...); inline std::string logFile; + inline int64_t* disableLogs = nullptr; }; \ No newline at end of file -- cgit v1.2.3