From 359df96d53a835fc1156cc040190186cd7931ccd Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:58:29 +0200 Subject: [PATCH] fix wlr logging --- src/debug/Log.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index a341f4b4..67c160bc 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -13,7 +13,19 @@ void Debug::init(std::string IS) { } void Debug::wlrLog(wlr_log_importance level, const char* fmt, va_list args) { - Debug::log(NONE, std::string("[wlr] " + std::string(fmt)).c_str(), args); + char* outputStr = nullptr; + + std::ofstream ofs; + ofs.open(logFile, std::ios::out | std::ios::app); + + vasprintf(&outputStr, fmt, args); + + std::string output = std::string(outputStr); + free(outputStr); + + ofs << "[wlr] " << output << "\n"; + + ofs.close(); } void Debug::log(LogLevel level, const char* fmt, ...) {