diff --git a/LibationLauncher/LibationLauncher.csproj b/LibationLauncher/LibationLauncher.csproj index e3f62792..4d059f2d 100644 --- a/LibationLauncher/LibationLauncher.csproj +++ b/LibationLauncher/LibationLauncher.csproj @@ -13,7 +13,7 @@ win-x64 - 5.3.6.1 + 5.3.6.5 diff --git a/LibationLauncher/Program.cs b/LibationLauncher/Program.cs index a1afc51a..f4222d0a 100644 --- a/LibationLauncher/Program.cs +++ b/LibationLauncher/Program.cs @@ -328,19 +328,7 @@ namespace LibationLauncher DecryptInProgressFiles = Directory.EnumerateFiles(AudibleFileStorage.DecryptInProgress).Count(), }); - // when turning on debug (and especially Verbose) to share logs, some privacy settings may not be obscured - if (Log.Logger.IsVerboseEnabled()) - MessageBox.Show(@" -Warning: verbose logging is enabled. - -This should be used for debugging only. It creates many -more logs and debug files, neither of which are as -strictly anonomous. - -When you are finished debugging, it's highly recommended -to set your debug MinimumLevel to Information and restart -Libation. -".Trim(), "Verbose logging enabled", MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBoxVerboseLoggingWarning.ShowIfTrue(); } private static void checkForUpdate(Configuration config) diff --git a/LibationWinForms/Dialogs/SettingsDialog.cs b/LibationWinForms/Dialogs/SettingsDialog.cs index 74b82f4d..fee85e1d 100644 --- a/LibationWinForms/Dialogs/SettingsDialog.cs +++ b/LibationWinForms/Dialogs/SettingsDialog.cs @@ -94,7 +94,16 @@ namespace LibationWinForms.Dialogs config.Books = newBooks; - config.LogLevel = (Serilog.Events.LogEventLevel)loggingLevelCb.SelectedItem; + { + var logLevelOld = config.LogLevel; + var logLevelNew = (Serilog.Events.LogEventLevel)loggingLevelCb.SelectedItem; + + config.LogLevel = logLevelNew; + + // only warn if changed during this time. don't want to warn every time user happens to change settings while level is verbose + if (logLevelOld != logLevelNew) + MessageBoxVerboseLoggingWarning.ShowIfTrue(); + } config.AllowLibationFixup = allowLibationFixupCbox.Checked; config.DecryptToLossy = convertLossyRb.Checked; diff --git a/LibationWinForms/MessageBoxWarnIfVerboseLogging.cs b/LibationWinForms/MessageBoxWarnIfVerboseLogging.cs new file mode 100644 index 00000000..7b33a22c --- /dev/null +++ b/LibationWinForms/MessageBoxWarnIfVerboseLogging.cs @@ -0,0 +1,27 @@ +using System; +using System.Windows.Forms; +using Dinah.Core.Logging; +using Serilog; + +namespace LibationWinForms +{ + public static class MessageBoxVerboseLoggingWarning + { + public static void ShowIfTrue() + { + // when turning on debug (and especially Verbose) to share logs, some privacy settings may not be obscured + if (Log.Logger.IsVerboseEnabled()) + MessageBox.Show(@" +Warning: verbose logging is enabled. + +This should be used for debugging only. It creates many +more logs and debug files, neither of which are as +strictly anonomous. + +When you are finished debugging, it's highly recommended +to set your debug MinimumLevel to Information and restart +Libation. +".Trim(), "Verbose logging enabled", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } +}