aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorswurl <swurl@swurl.xyz>2025-05-08 06:20:20 +0000
committercrueter <crueter@noreply.localhost>2025-05-08 06:20:20 +0000
commitd659d6f5b4a03f27d0cde7e1fd2f9da60095b5d0 (patch)
treeab108b629932c3c04526bc5c8ff6b5d0edc55310 /src
parentc2c7b2ad8a5f5c54b45cdb815e2f5ebe6975380a (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp12
-rw-r--r--src/common/settings.h1
-rw-r--r--src/yuzu/configuration/configure_debug.cpp2
-rw-r--r--src/yuzu/configuration/configure_debug.ui61
4 files changed, 43 insertions, 33 deletions
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<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.
diff --git a/src/common/settings.h b/src/common/settings.h
index 646051f24c..709ca03e7c 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -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
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp
index 1010038b76..5f23eea3d3 100644
--- a/src/yuzu/configuration/configure_debug.cpp
+++ b/src/yuzu/configuration/configure_debug.cpp
@@ -39,6 +39,7 @@ void ConfigureDebug::SetConfiguration() {
ui->toggle_console->setEnabled(runtime_lock);
ui->toggle_console->setChecked(UISettings::values.show_console.GetValue());
ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter.GetValue()));
+ ui->flush_line->setChecked(Settings::values.log_flush_lines.GetValue());
ui->homebrew_args_edit->setText(
QString::fromStdString(Settings::values.program_args.GetValue()));
ui->fs_access_log->setEnabled(runtime_lock);
@@ -88,6 +89,7 @@ void ConfigureDebug::ApplyConfiguration() {
Settings::values.gdbstub_port = ui->gdbport_spinbox->value();
UISettings::values.show_console = ui->toggle_console->isChecked();
Settings::values.log_filter = ui->log_filter_edit->text().toStdString();
+ Settings::values.log_flush_lines = ui->flush_line->isChecked();
Settings::values.program_args = ui->homebrew_args_edit->text().toStdString();
Settings::values.enable_fs_access_log = ui->fs_access_log->isChecked();
Settings::values.reporting_services = ui->reporting_services->isChecked();
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui
index d842b01352..68c5a67b24 100644
--- a/src/yuzu/configuration/configure_debug.ui
+++ b/src/yuzu/configuration/configure_debug.ui
@@ -18,8 +18,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>842</width>
- <height>741</height>
+ <width>829</width>
+ <height>758</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
@@ -40,7 +40,7 @@
<string>Debugger</string>
</property>
<property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
<property name="flat">
<bool>false</bool>
@@ -59,7 +59,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
+ <enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
@@ -355,10 +355,10 @@
<item row="10" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Preferred</enum>
+ <enum>QSizePolicy::Policy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -452,10 +452,10 @@
<item row="7" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
+ <enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -474,37 +474,27 @@
<string>Debugging</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QCheckBox" name="fs_access_log">
- <property name="text">
- <string>Enable FS Access Log</string>
- </property>
- </widget>
- </item>
<item row="3" column="0">
- <widget class="QCheckBox" name="dump_audio_commands">
- <property name="toolTip">
- <string>Enable this to output the latest generated audio command list to the console. Only affects games using the audio renderer.</string>
- </property>
+ <widget class="QCheckBox" name="reporting_services">
<property name="text">
- <string>Dump Audio Commands To Console**</string>
+ <string>Enable Verbose Reporting Services**</string>
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="reporting_services">
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="fs_access_log">
<property name="text">
- <string>Enable Verbose Reporting Services**</string>
+ <string>Enable FS Access Log</string>
</property>
</widget>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
+ <enum>QSizePolicy::Policy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -514,6 +504,23 @@
</property>
</spacer>
</item>
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="dump_audio_commands">
+ <property name="toolTip">
+ <string>Enable this to output the latest generated audio command list to the console. Only affects games using the audio renderer.</string>
+ </property>
+ <property name="text">
+ <string>Dump Audio Commands To Console**</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="flush_line">
+ <property name="text">
+ <string>Flush log output on each line</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -522,7 +529,7 @@
<item>
<spacer name="verticalSpacer">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>