##// END OF EJS Templates
README.md edited online with Bitbucket
README.md edited online with Bitbucket

File last commit:

r134:04d4c92d0f28 v2
r282:12b89f1cfe9f default
Show More
ConsoleTraceListener.cs
22 lines | 668 B | text/x-csharp | CSharpLexer
/ Implab / Diagnostics / ConsoleTraceListener.cs
cin
improved log concept
r36 using System;
using System.Text;
namespace Implab.Diagnostics {
cin
Improved logging
r134 public class ConsoleTraceListener: ListenerBase {
cin
improved log concept
r36
static readonly object _consoleLock = new object();
cin
Improved logging
r134 public override void Write(LogEventArgs args, object entry) {
cin
improved tracing...
r40 var msg = new StringBuilder();
cin
improved log concept
r36
cin
Improved logging
r134 for (int i = 0; i < args.Operation.Level; i++)
cin
improved log concept
r36 msg.Append(" ");
cin
Improved logging
r134 msg.AppendFormat("[{0}]: {1}", args.ThreadId, entry);
cin
improved log concept
r36
lock (_consoleLock) {
cin
sync
r133 Console.ForegroundColor = (ConsoleColor)(args.ThreadId % 15 + 1);
cin
rewritten tracing
r92 Console.WriteLine(msg);
cin
improved log concept
r36 }
}
}
}