--- trunk/RomCheater.Logging/LogWriter.cs 2012/05/09 08:43:52 22 +++ trunk/RomCheater.Logging/LogWriter.cs 2012/05/09 08:51:38 23 @@ -8,13 +8,13 @@ using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; +using System.Reflection; namespace RomCheater.Logging { public partial class LogWriter : UserControl { - public const string LOG_FILE = "RomCheater.log"; - private static string LOG_PATH = string.Format(@"{0}\{1}", Application.StartupPath, LOG_FILE); + private static string LOG_PATH = string.Format(@"{0}\{1}", Application.StartupPath, LoggingConstants.AppLogFile); private delegate string OnGetLogText(); private delegate void OnSetLogText(string value); @@ -155,11 +155,16 @@ namespace RomCheater.Logging throw new InvalidOperationException("Please use SetLogText(string value)"); } } - public void CreateNewLog() + public void CreateNewLog(bool delete) { - FileInfo fi = new FileInfo(LOG_PATH); - if (fi.Exists) - fi.Delete(); + if (delete) + { + FileInfo fi = new FileInfo(LOG_PATH); + if (fi.Exists) + fi.Delete(); + } + Log.WriteLine("{0} created on {1}", LoggingConstants.AppLogFile, DateTime.Now.ToString()); + Log.WriteLine("{0} version: {1} {2} build", LoggingConstants.AppName, LoggingConstants.AppVersion, LoggingConstants.AppBuild); } public void Clear() { |