From d659d6f5b4a03f27d0cde7e1fd2f9da60095b5d0 Mon Sep 17 00:00:00 2001 From: swurl Date: Thu, 8 May 2025 06:20:20 +0000 Subject: Runtime option for flushing logs by line (#90) Signed-off-by: swurl Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/90 Co-authored-by: swurl Co-committed-by: swurl --- src/common/logging/backend.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/common/logging/backend.cpp') diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 5ce1c2582e..3b400c6566 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -88,8 +88,8 @@ public: auto old_filename = filename; old_filename += ".old.txt"; - // Existence checks are done within the functions themselves. - // We don't particularly care if these succeed or not. + // Existence checks are done within the functions themselves. + // We don't particularly care if these succeed or not. static_cast(FS::RemoveFile(old_filename)); static_cast(FS::RenameFile(filename, old_filename)); @@ -106,10 +106,10 @@ public: bytes_written += file->WriteString(FormatLogMessage(entry).append(1, '\n')); - // Option to log each line rather than 4k buffers -#ifdef YUZU_LOG_BY_LINE - file->Flush(); -#endif + // Option to log each line rather than 4k buffers + if (Settings::values.log_flush_lines.GetValue()) { + file->Flush(); + } using namespace Common::Literals; // Prevent logs from exceeding a set maximum size in the event that log entries are spammed. -- cgit v1.2.3