Mercurial > pub > ImplabNet
annotate Implab/Diagnostics/TraceEvent.cs @ 145:706fccb85524 v2
RC: cancellation support for promises + tests
author | cin |
---|---|
date | Sun, 08 Mar 2015 02:52:27 +0300 |
parents | 6c49d02a9a05 |
children | ea485487a424 |
rev | line source |
---|---|
36 | 1 using System; |
2 | |
3 namespace Implab.Diagnostics { | |
4 public class TraceEvent { | |
5 public string Message { | |
6 get; | |
7 private set; | |
8 } | |
9 | |
10 public TraceEventType EventType { | |
11 get; | |
12 private set; | |
13 } | |
14 | |
15 public TraceEvent(TraceEventType type, string message) { | |
16 EventType = type; | |
17 Message = message; | |
18 } | |
19 | |
40 | 20 public override string ToString() { |
133 | 21 /*return EventType == TraceEventType.Information ? Message : String.Format("{0}: {1}", EventType, Message);*/ |
22 return Message; | |
40 | 23 } |
24 | |
36 | 25 public static TraceEvent Create(TraceEventType type, string format, params object[] args) { |
43
7c2369f580b8
improved tracing, TextListenerBase can be bound to logical operation scope.
cin
parents:
42
diff
changeset
|
26 return new TraceEvent(type, format == null ? String.Empty : String.Format(format, args)); |
36 | 27 } |
28 } | |
29 } |