diff --git a/Implab/Diagnostics/LogChannel.cs b/Implab/Diagnostics/LogChannel.cs --- a/Implab/Diagnostics/LogChannel.cs +++ b/Implab/Diagnostics/LogChannel.cs @@ -20,5 +20,11 @@ namespace Implab.Diagnostics { if (t!= null) t(TraceContext.Current,new ValueEventArgs(data)); } + + public void LogEvent(TraceContext context,TEvent data) { + var t = Events; + if (t != null) + t(context, new ValueEventArgs(data)); + } } } diff --git a/Implab/Diagnostics/TraceContext.cs b/Implab/Diagnostics/TraceContext.cs --- a/Implab/Diagnostics/TraceContext.cs +++ b/Implab/Diagnostics/TraceContext.cs @@ -34,7 +34,7 @@ namespace Implab.Diagnostics { 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 @@ namespace Implab.Diagnostics { } void LogEvent(TraceEventType type, string format, params object[] args) { - LogChannel.Default.LogEvent(TraceEvent.Create(type, format, args)); + LogChannel.Default.LogEvent(this, TraceEvent.Create(type, format, args)); } } }