diff --git a/EnvyUpdate/InfoWindow.xaml.cs b/EnvyUpdate/InfoWindow.xaml.cs index 25c2f5d..6f369cb 100644 --- a/EnvyUpdate/InfoWindow.xaml.cs +++ b/EnvyUpdate/InfoWindow.xaml.cs @@ -34,17 +34,23 @@ namespace EnvyUpdate private void chkLog_Checked(object sender, RoutedEventArgs e) { - Debug.isVerbose = true; - Debug.LogToFile("------"); - Debug.LogToFile("INFO Enabled logging to file. Restart Application to see full startup log."); + if (!Debug.isVerbose) + { + Debug.isVerbose = true; + Debug.LogToFile("------"); + Debug.LogToFile("INFO Enabled logging to file. Restart Application to see full startup log."); + } } private void chkLog_Unchecked(object sender, RoutedEventArgs e) { - Debug.LogToFile("INFO Disabled logging to file."); - if (File.Exists(Path.Combine(GlobalVars.exedirectory, "envyupdate.log"))) - File.Move(Path.Combine(GlobalVars.exedirectory, "envyupdate.log"), Path.Combine(GlobalVars.exedirectory, "envyupdate." + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".log")); - Debug.isVerbose = false; + if (Debug.isVerbose) + { + Debug.LogToFile("INFO Disabled logging to file."); + if (File.Exists(Path.Combine(GlobalVars.exedirectory, "envyupdate.log"))) + File.Move(Path.Combine(GlobalVars.exedirectory, "envyupdate.log"), Path.Combine(GlobalVars.exedirectory, "envyupdate." + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".log")); + Debug.isVerbose = false; + } } } }