Mercurial > pub > ImplabNet
changeset 37:c2c043520724 diagnostics
working version of diagnostics logging
author | cin |
---|---|
date | Tue, 15 Apr 2014 02:46:18 +0400 |
parents | 313f708a50e9 |
children | 1cedc4e58acc |
files | Implab/Diagnostics/LogChannel.cs Implab/Diagnostics/TraceContext.cs |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Implab/Diagnostics/LogChannel.cs Tue Apr 15 02:00:09 2014 +0400 +++ b/Implab/Diagnostics/LogChannel.cs Tue Apr 15 02:46:18 2014 +0400 @@ -20,5 +20,11 @@ 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)); + } } }
--- a/Implab/Diagnostics/TraceContext.cs Tue Apr 15 02:00:09 2014 +0400 +++ b/Implab/Diagnostics/TraceContext.cs Tue Apr 15 02:46:18 2014 +0400 @@ -34,7 +34,7 @@ m_traceBound = context.CurrentOperation; m_threadId = Thread.CurrentThread.ManagedThreadId; - LogEvent(TraceEventType.Transfer, String.Empty); + LogEvent(TraceEventType.Transfer, "FORK {0}", context.ThreadId); } TraceContext() { @@ -91,7 +91,7 @@ } void LogEvent(TraceEventType type, string format, params object[] args) { - LogChannel<TraceEvent>.Default.LogEvent(TraceEvent.Create(type, format, args)); + LogChannel<TraceEvent>.Default.LogEvent(this, TraceEvent.Create(type, format, args)); } } }