Mercurial > pub > ImplabNet
annotate Implab/Diagnostics/TraceEvent.cs @ 189:b60643b47078 ref20160224
Закрыть ветку ref20160224
author | cin |
---|---|
date | Fri, 22 Apr 2016 13:07:41 +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 } |