comparison Implab/Diagnostics/TraceEvent.cs @ 93:dc4942d09e74 v2

improved tracing added the application components container MTComponentContainer.AppContainer
author cin
date Thu, 23 Oct 2014 01:13:57 +0400
parents edf0bc558596
children 6c49d02a9a05
comparison
equal deleted inserted replaced
92:4c0e5ef99986 93:dc4942d09e74
1 using System; 1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 2
6 namespace Implab.Diagnostics { 3 namespace Implab.Diagnostics {
7 public class TraceEvent { 4 public class TraceEvent {
8 public string Message { 5 public string Message {
9 get; 6 get;
19 EventType = type; 16 EventType = type;
20 Message = message; 17 Message = message;
21 } 18 }
22 19
23 public override string ToString() { 20 public override string ToString() {
24 if (EventType == TraceEventType.Information) 21 return EventType == TraceEventType.Information ? Message : String.Format("{0}: {1}", EventType, Message);
25 return Message;
26 else
27 return String.Format("{0}: {1}", EventType, Message);
28 } 22 }
29 23
30 public static TraceEvent Create(TraceEventType type, string format, params object[] args) { 24 public static TraceEvent Create(TraceEventType type, string format, params object[] args) {
31 return new TraceEvent(type, format == null ? String.Empty : String.Format(format, args)); 25 return new TraceEvent(type, format == null ? String.Empty : String.Format(format, args));
32 } 26 }