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

--- trunk/RomCheater.Logging/LogWriter.cs	2012/05/10 10:53:07	105
+++ trunk/RomCheater.Logging/LogWriter.cs	2012/05/10 11:15:23	106
@@ -129,21 +129,19 @@ namespace RomCheater.Logging
         }
         public void SetLogText(string value)
         {
-            //if (txtLog.InvokeRequired)
-            //{
-            //    this.Invoke(HandleSetLogText, new object[] { value });
-            //}
-            //else
-            //{
-            //    txtLog.AppendText(value);
-            //}
             FileStream fs = new FileStream(LOG_PATH, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
             StreamWriter writer = new StreamWriter(fs);
             writer.AutoFlush = true;
             if (value == Log.NewLine) { writer.Write(System.Environment.NewLine); }
             else { writer.Write(value); }
             writer.Close();
-            sw.Write(value);
+            //string text = value.Replace(System.Environment.NewLine,"");
+            string text = value.Replace(System.Environment.NewLine, Log.NewLine);
+            if (text.StartsWith(Log.NewLine))
+            {
+                text = text.Remove(0, Log.NewLine.Length);
+            }
+            sw.Write(text);
             Application.DoEvents();
         }
 
@@ -199,8 +197,9 @@ namespace RomCheater.Logging
             {
                 if (_text_writer == null) return;
 
-                if (message.EndsWith("\n"))
+                if (message.EndsWith(this.NewLine))
                 {
+                    strMessage.Append(System.Environment.NewLine);
                     //_text_writer.SetLogText(string.Format("{0}", strMessage.ToString()));
                     while (_text_writer.logupdater.IsBusy)
                     {