Mercurial > pub > ImplabNet
view Implab/Diagnostics/LogChannel.cs @ 47:b181f7bcb259 interactive logger
refactoring, interactive tarce log almost complete
author | cin |
---|---|
date | Thu, 17 Apr 2014 18:49:36 +0400 |
parents | c2c043520724 |
children | d9d794b61bb9 |
line wrap: on
line source
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Implab.Diagnostics { public class LogChannel<TEvent> { static LogChannel<TEvent> _default = new LogChannel<TEvent>(); public static LogChannel<TEvent> Default { get { return _default; } } public event EventHandler<ValueEventArgs<TEvent>> Events; public void LogEvent(TEvent data) { var t = Events; if (t!= null) t(TraceContext.Current,new ValueEventArgs<TEvent>(data)); } public void LogEvent(TraceContext context,TEvent data) { var t = Events; if (t != null) t(context, new ValueEventArgs<TEvent>(data)); } } }