mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 18:05:46 +00:00
Runtime option for flushing logs by line (#90)
Signed-off-by: swurl <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/90 Co-authored-by: swurl <swurl@swurl.xyz> Co-committed-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
c2c7b2ad8a
commit
d659d6f5b4
5 changed files with 45 additions and 41 deletions
|
@ -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<void>(FS::RemoveFile(old_filename));
|
||||
static_cast<void>(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.
|
||||
|
|
|
@ -627,6 +627,7 @@ struct Values {
|
|||
|
||||
// Miscellaneous
|
||||
Setting<std::string> log_filter{linkage, "*:Info", "log_filter", Category::Miscellaneous};
|
||||
Setting<bool> log_flush_lines{linkage, false, "flush_lines", Category::Miscellaneous};
|
||||
Setting<bool> use_dev_keys{linkage, false, "use_dev_keys", Category::Miscellaneous};
|
||||
|
||||
// Network
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue