##// END OF EJS Templates
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.

File last commit:

r134:04d4c92d0f28 v2
r196:40d7fed4a09e 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 }
}
}
}