ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.Logging/LogWriter.cs
(Generate patch)

Comparing trunk/RomCheater.Logging/LogWriter.cs (file contents):
Revision 22 by william, Wed May 9 08:43:52 2012 UTC vs.
Revision 23 by william, Wed May 9 08:51:38 2012 UTC

# Line 8 | Line 8 | using System.Linq;
8   using System.Text;
9   using System.Windows.Forms;
10   using System.IO;
11 + using System.Reflection;
12  
13   namespace RomCheater.Logging
14   {
15      public partial class LogWriter : UserControl
16      {
17 <        public const string LOG_FILE = "RomCheater.log";
17 <        private static string LOG_PATH = string.Format(@"{0}\{1}", Application.StartupPath, LOG_FILE);
17 >        private static string LOG_PATH = string.Format(@"{0}\{1}", Application.StartupPath, LoggingConstants.AppLogFile);
18  
19          private delegate string OnGetLogText();
20          private delegate void OnSetLogText(string value);
# Line 155 | Line 155 | namespace RomCheater.Logging
155                  throw new InvalidOperationException("Please use SetLogText(string value)");
156              }
157          }
158 <        public void CreateNewLog()
158 >        public void CreateNewLog(bool delete)
159          {
160 <            FileInfo fi = new FileInfo(LOG_PATH);
161 <            if (fi.Exists)
162 <                fi.Delete();
160 >            if (delete)
161 >            {
162 >                FileInfo fi = new FileInfo(LOG_PATH);
163 >                if (fi.Exists)
164 >                    fi.Delete();
165 >            }
166 >            Log.WriteLine("{0} created on {1}", LoggingConstants.AppLogFile, DateTime.Now.ToString());
167 >            Log.WriteLine("{0} version: {1} {2} build", LoggingConstants.AppName, LoggingConstants.AppVersion, LoggingConstants.AppBuild);
168          }
169          public void Clear()
170          {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines