diff --git a/Implab/Diagnostics/TraceContext.cs b/Implab/Diagnostics/TraceContext.cs --- a/Implab/Diagnostics/TraceContext.cs +++ b/Implab/Diagnostics/TraceContext.cs @@ -48,7 +48,7 @@ namespace Implab.Diagnostics { } public void StartLogicalOperation(string name) { - LogChannel.Default.LogEvent(new TraceEvent(TraceEventType.OperationStarted, name)); + LogChannel.Default.LogEvent(new TraceEvent(TraceContext.Instance.CurrentOperation, TraceEventType.OperationStarted, name)); m_current.BeginLogicalOperation(name); } diff --git a/Implab/Diagnostics/TraceLog.cs b/Implab/Diagnostics/TraceLog.cs --- a/Implab/Diagnostics/TraceLog.cs +++ b/Implab/Diagnostics/TraceLog.cs @@ -34,7 +34,7 @@ namespace Implab.Diagnostics { [Conditional("TRACE")] public static void EndLogicalOperation() { var op = TraceContext.Instance.EndLogicalOperation(); - LogChannel.Default.LogEvent(new TraceEvent(TraceEventType.OperationCompleted, String.Format("-{0} : {1}ms",op.Name, op.Duration))); + LogChannel.Default.LogEvent(new TraceEvent(op, TraceEventType.OperationCompleted, String.Format("-{0} : {1}ms",op.Name, op.Duration))); } /// @@ -44,7 +44,7 @@ namespace Implab.Diagnostics { /// Arguments. [Conditional("TRACE")] public static void TraceInformation(string format, params object[] arguments) { - LogChannel.Default.LogEvent(TraceEvent.Create(TraceEventType.Information, format, arguments)); + LogChannel.Default.LogEvent(TraceEvent.Create(TraceContext.Instance.CurrentOperation, TraceEventType.Information, format, arguments)); } /// @@ -54,12 +54,12 @@ namespace Implab.Diagnostics { /// Arguments. [Conditional("TRACE")] public static void TraceWarning(string format, params object[] arguments) { - LogChannel.Default.LogEvent(TraceEvent.Create(TraceEventType.Warning, format, arguments)); + LogChannel.Default.LogEvent(TraceEvent.Create(TraceContext.Instance.CurrentOperation, TraceEventType.Warning, format, arguments)); } [Conditional("TRACE")] public static void TraceError(string format, params object[] arguments) { - LogChannel.Default.LogEvent(TraceEvent.Create(TraceEventType.Error, format, arguments)); + LogChannel.Default.LogEvent(TraceEvent.Create(TraceContext.Instance.CurrentOperation, TraceEventType.Error, format, arguments)); } [Conditional("TRACE")]