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 105 by william, Thu May 10 10:53:07 2012 UTC vs.
Revision 106 by william, Thu May 10 11:15:23 2012 UTC

# Line 129 | Line 129 | namespace RomCheater.Logging
129          }
130          public void SetLogText(string value)
131          {
132            //if (txtLog.InvokeRequired)
133            //{
134            //    this.Invoke(HandleSetLogText, new object[] { value });
135            //}
136            //else
137            //{
138            //    txtLog.AppendText(value);
139            //}
132              FileStream fs = new FileStream(LOG_PATH, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
133              StreamWriter writer = new StreamWriter(fs);
134              writer.AutoFlush = true;
135              if (value == Log.NewLine) { writer.Write(System.Environment.NewLine); }
136              else { writer.Write(value); }
137              writer.Close();
138 <            sw.Write(value);
138 >            //string text = value.Replace(System.Environment.NewLine,"");
139 >            string text = value.Replace(System.Environment.NewLine, Log.NewLine);
140 >            if (text.StartsWith(Log.NewLine))
141 >            {
142 >                text = text.Remove(0, Log.NewLine.Length);
143 >            }
144 >            sw.Write(text);
145              Application.DoEvents();
146          }
147  
# Line 199 | Line 197 | namespace RomCheater.Logging
197              {
198                  if (_text_writer == null) return;
199  
200 <                if (message.EndsWith("\n"))
200 >                if (message.EndsWith(this.NewLine))
201                  {
202 +                    strMessage.Append(System.Environment.NewLine);
203                      //_text_writer.SetLogText(string.Format("{0}", strMessage.ToString()));
204                      while (_text_writer.logupdater.IsBusy)
205                      {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines