diff options
author | vaxerski <[email protected]> | 2022-08-22 18:58:29 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-22 18:58:29 +0200 |
commit | 359df96d53a835fc1156cc040190186cd7931ccd (patch) | |
tree | 36e9c6147dbe53a9bff374c10a917cf01d657d38 /src/debug/Log.cpp | |
parent | 63493b57363f592861f160a38164f2f7198a7812 (diff) | |
download | Hyprland-359df96d53a835fc1156cc040190186cd7931ccd.tar.gz Hyprland-359df96d53a835fc1156cc040190186cd7931ccd.zip |
fix wlr logging
Diffstat (limited to 'src/debug/Log.cpp')
-rw-r--r-- | src/debug/Log.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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, ...) { |