fix wlr logging

This commit is contained in:
vaxerski 2022-08-22 18:58:29 +02:00
parent 63493b5736
commit 359df96d53

View file

@ -13,7 +13,19 @@ void Debug::init(std::string IS) {
} }
void Debug::wlrLog(wlr_log_importance level, const char* fmt, va_list args) { 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, ...) { void Debug::log(LogLevel level, const char* fmt, ...) {