diff Implab/Diagnostics/TextFileListener.cs @ 48:d9d794b61bb9 interactive logger

Interactive tracing Improved working with tracing contexts
author cin
date Fri, 18 Apr 2014 12:34:45 +0400
parents b181f7bcb259
children 4c0e5ef99986
line wrap: on
line diff
--- a/Implab/Diagnostics/TextFileListener.cs	Thu Apr 17 18:49:36 2014 +0400
+++ b/Implab/Diagnostics/TextFileListener.cs	Fri Apr 18 12:34:45 2014 +0400
@@ -8,18 +8,19 @@
     public class TextFileListener: TextListenerBase {
         readonly TextWriter m_textWriter;
 
-        public TextFileListener(string fileName, bool local) : base(local) {
+        public TextFileListener(string fileName, bool global)
+            : base(global) {
             m_textWriter = File.CreateText(fileName);
 
             m_textWriter.WriteLine("LOG {0}", DateTime.Now);
             Register(this);
         }
 
-        protected override void WriteEntry(TraceContext context, EventText text) {
+        protected override void WriteEntry(TraceContext context, EventText text, string channel) {
             var msg = new StringBuilder();
             for (int i = 0; i < text.indent; i++)
                 msg.Append("  ");
-            msg.AppendFormat("[{0}]: {1}", context.ThreadId, text.content);
+            msg.AppendFormat("[{0}]:{1}: {2}", context.ThreadId, channel, text.content);
 
             lock (m_textWriter) {
                 if (!IsDisposed) {