comparison Implab/Diagnostics/LogChannel.cs @ 36:313f708a50e9 diagnostics

improved log concept
author cin
date Tue, 15 Apr 2014 02:00:09 +0400
parents
children c2c043520724
comparison
equal deleted inserted replaced
35:2880242f987a 36:313f708a50e9
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace Implab.Diagnostics {
7 public class LogChannel<TEvent> {
8 static LogChannel<TEvent> _default = new LogChannel<TEvent>();
9
10 public static LogChannel<TEvent> Default {
11 get {
12 return _default;
13 }
14 }
15
16 public event EventHandler<ValueEventArgs<TEvent>> Events;
17
18 public void LogEvent(TEvent data) {
19 var t = Events;
20 if (t!= null)
21 t(TraceContext.Current,new ValueEventArgs<TEvent>(data));
22 }
23 }
24 }