diff --git a/RetroBar/App.config b/RetroBar/App.config
index 0b19189b..48285ad7 100644
--- a/RetroBar/App.config
+++ b/RetroBar/App.config
@@ -64,6 +64,9 @@
1
+
+ False
+
\ No newline at end of file
diff --git a/RetroBar/Languages/English.xaml b/RetroBar/Languages/English.xaml
index 09ec90a0..68894474 100644
--- a/RetroBar/Languages/English.xaml
+++ b/RetroBar/Languages/English.xaml
@@ -45,6 +45,7 @@
100%
200%
Current setting: {0}%
+ Enable debug logging
OK
Customize Notifications
diff --git a/RetroBar/Properties/Settings.Designer.cs b/RetroBar/Properties/Settings.Designer.cs
index 751c38cf..12f7914d 100644
--- a/RetroBar/Properties/Settings.Designer.cs
+++ b/RetroBar/Properties/Settings.Designer.cs
@@ -251,5 +251,17 @@ public double TaskbarScale {
this["TaskbarScale"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool DebugLogging {
+ get {
+ return ((bool)(this["DebugLogging"]));
+ }
+ set {
+ this["DebugLogging"] = value;
+ }
+ }
}
}
diff --git a/RetroBar/Properties/Settings.settings b/RetroBar/Properties/Settings.settings
index 042c1d52..f761ebc3 100644
--- a/RetroBar/Properties/Settings.settings
+++ b/RetroBar/Properties/Settings.settings
@@ -59,5 +59,8 @@
1
+
+ False
+
\ No newline at end of file
diff --git a/RetroBar/PropertiesWindow.xaml b/RetroBar/PropertiesWindow.xaml
index 0b24db9e..17ae3bc3 100644
--- a/RetroBar/PropertiesWindow.xaml
+++ b/RetroBar/PropertiesWindow.xaml
@@ -295,6 +295,10 @@
IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=UseSoftwareRendering, UpdateSourceTrigger=PropertyChanged}">
+
+
+
diff --git a/RetroBar/Utilities/ManagedShellLogger.cs b/RetroBar/Utilities/ManagedShellLogger.cs
index ac620512..a853394d 100644
--- a/RetroBar/Utilities/ManagedShellLogger.cs
+++ b/RetroBar/Utilities/ManagedShellLogger.cs
@@ -10,18 +10,31 @@ class ManagedShellLogger : IDisposable
private string _logPath = Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "RetroBar"), "Logs");
private string _logName = DateTime.Now.ToString("yyyy-MM-dd_HHmmssfff");
private string _logExt = "log";
- private LogSeverity _logSeverity = LogSeverity.Debug;
private TimeSpan _logRetention = new TimeSpan(7, 0, 0);
private FileLog _fileLog;
public ManagedShellLogger()
{
SetupLogging();
+ Settings.Instance.PropertyChanged += Settings_PropertyChanged;
+ }
+
+ private void Settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == "DebugLogging")
+ {
+ SetSeverity();
+ }
+ }
+
+ private void SetSeverity()
+ {
+ ShellLogger.Severity = Settings.Instance.DebugLogging ? LogSeverity.Debug : LogSeverity.Info;
}
private void SetupLogging()
{
- ShellLogger.Severity = _logSeverity;
+ SetSeverity();
SetupFileLog();
@@ -64,6 +77,7 @@ private void DeleteOldLogFiles()
public void Dispose()
{
+ Settings.Instance.PropertyChanged -= Settings_PropertyChanged;
_fileLog?.Dispose();
}
}
diff --git a/RetroBar/Utilities/Settings.cs b/RetroBar/Utilities/Settings.cs
index 70e52357..6cd1e78b 100644
--- a/RetroBar/Utilities/Settings.cs
+++ b/RetroBar/Utilities/Settings.cs
@@ -382,6 +382,21 @@ public double TaskbarScale
}
}
}
+
+ public bool DebugLogging
+ {
+ get
+ {
+ return settings.DebugLogging;
+ }
+ set
+ {
+ if (settings.DebugLogging != value)
+ {
+ settings.DebugLogging = value;
+ }
+ }
+ }
#endregion
#region Helpers