/[RomCheater]/trunk/RomCheater.Logging/LogWriter.cs
ViewVC logotype

Diff of /trunk/RomCheater.Logging/LogWriter.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- 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 @@
         }
         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 @@
             {
                 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)
                     {

 

  ViewVC Help
Powered by ViewVC 1.1.22