diff options
author | vaxerski <[email protected]> | 2023-03-24 13:00:54 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-03-24 13:00:54 +0000 |
commit | e73c6fd3b03492760aa3787794d16c3fcf5458bf (patch) | |
tree | ea295353f9b7010de2a2466c7f6b1effd913da14 | |
parent | a5a0434fffcd1b691506f694e5e9f9091b859a85 (diff) | |
download | Hyprland-e73c6fd3b03492760aa3787794d16c3fcf5458bf.tar.gz Hyprland-e73c6fd3b03492760aa3787794d16c3fcf5458bf.zip |
logs: disable stdout after init
-rw-r--r-- | src/Compositor.cpp | 4 | ||||
-rw-r--r-- | src/debug/Log.cpp | 3 | ||||
-rw-r--r-- | src/debug/Log.hpp | 5 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 72956582..b145022c 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -85,6 +85,10 @@ void CCompositor::setRandomSplash() { } void CCompositor::initServer() { + + Debug::log(LOG, "Disabling stdout logs! Check the log for further logs."); + Debug::disableStdout = true; + m_sWLDisplay = wl_display_create(); m_sWLEventLoop = wl_display_get_event_loop(m_sWLDisplay); diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index 7800b831..8b1a8fab 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -75,5 +75,6 @@ void Debug::log(LogLevel level, const char* fmt, ...) { ofs.close(); // log it to the stdout too. - std::cout << output << "\n"; + if (!disableStdout) + std::cout << output << "\n"; } diff --git a/src/debug/Log.hpp b/src/debug/Log.hpp index 98d176af..a159a2da 100644 --- a/src/debug/Log.hpp +++ b/src/debug/Log.hpp @@ -20,6 +20,7 @@ namespace Debug { void wlrLog(wlr_log_importance level, const char* fmt, va_list args); inline std::string logFile; - inline int64_t* disableLogs = nullptr; - inline int64_t* disableTime = nullptr; + inline int64_t* disableLogs = nullptr; + inline int64_t* disableTime = nullptr; + inline bool disableStdout = false; };
\ No newline at end of file |