fix disableLogs

This commit is contained in:
Vaxry 2024-02-14 16:24:06 +00:00
parent 3566efa667
commit 7af2e270fd
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ void Debug::wlrLog(wlr_log_importance level, const char* fmt, va_list args) {
rollingLog += output + "\n"; rollingLog += output + "\n";
if (!disableLogs || !*disableLogs) { if (!disableLogs || !**disableLogs) {
std::ofstream ofs; std::ofstream ofs;
ofs.open(logFile, std::ios::out | std::ios::app); ofs.open(logFile, std::ios::out | std::ios::app);
ofs << "[wlr] " << output << "\n"; ofs << "[wlr] " << output << "\n";

View file

@ -52,7 +52,7 @@ namespace Debug {
} }
// print date and time to the ofs // print date and time to the ofs
if (disableTime && !*disableTime) { if (disableTime && !**disableTime) {
#ifndef _LIBCPP_VERSION #ifndef _LIBCPP_VERSION
logMsg += std::format("[{:%T}] ", std::chrono::hh_mm_ss{std::chrono::system_clock::now() - std::chrono::floor<std::chrono::days>(std::chrono::system_clock::now())}); logMsg += std::format("[{:%T}] ", std::chrono::hh_mm_ss{std::chrono::system_clock::now() - std::chrono::floor<std::chrono::days>(std::chrono::system_clock::now())});
#else #else
@ -73,7 +73,7 @@ namespace Debug {
if (rollingLog.size() > ROLLING_LOG_SIZE) if (rollingLog.size() > ROLLING_LOG_SIZE)
rollingLog = rollingLog.substr(rollingLog.size() - ROLLING_LOG_SIZE); rollingLog = rollingLog.substr(rollingLog.size() - ROLLING_LOG_SIZE);
if (!disableLogs || !*disableLogs) { if (!disableLogs || !**disableLogs) {
// log to a file // log to a file
std::ofstream ofs; std::ofstream ofs;
ofs.open(logFile, std::ios::out | std::ios::app); ofs.open(logFile, std::ios::out | std::ios::app);