comparison Implab/Diagnostics/ConsoleTraceListener.cs @ 43:7c2369f580b8

improved tracing, TextListenerBase can be bound to logical operation scope.
author cin
date Wed, 16 Apr 2014 10:12:56 +0400
parents fe33f4e02ad5
children d9d794b61bb9
comparison
equal deleted inserted replaced
42:3ba6778ed336 43:7c2369f580b8
5 5
6 namespace Implab.Diagnostics { 6 namespace Implab.Diagnostics {
7 public class ConsoleTraceListener: TextListenerBase { 7 public class ConsoleTraceListener: TextListenerBase {
8 8
9 static readonly object _consoleLock = new object(); 9 static readonly object _consoleLock = new object();
10
11 public ConsoleTraceListener()
12 : base(true) {
13
14 }
15
16 public ConsoleTraceListener(bool local)
17 : base(local) {
18
19 }
10 20
11 protected override void WriteEntry(TraceContext context, EventText text) { 21 protected override void WriteEntry(TraceContext context, EventText text) {
12 var msg = new StringBuilder(); 22 var msg = new StringBuilder();
13 23
14 for (int i = 0; i < text.indent; i++) 24 for (int i = 0; i < text.indent; i++)