comparison Implab/Diagnostics/TraceContext.cs @ 37:c2c043520724 diagnostics

working version of diagnostics logging
author cin
date Tue, 15 Apr 2014 02:46:18 +0400
parents 313f708a50e9
children fe33f4e02ad5
comparison
equal deleted inserted replaced
36:313f708a50e9 37:c2c043520724
32 m_parent = context; 32 m_parent = context;
33 m_currentOperation = context.CurrentOperation; 33 m_currentOperation = context.CurrentOperation;
34 m_traceBound = context.CurrentOperation; 34 m_traceBound = context.CurrentOperation;
35 m_threadId = Thread.CurrentThread.ManagedThreadId; 35 m_threadId = Thread.CurrentThread.ManagedThreadId;
36 36
37 LogEvent(TraceEventType.Transfer, String.Empty); 37 LogEvent(TraceEventType.Transfer, "FORK {0}", context.ThreadId);
38 } 38 }
39 39
40 TraceContext() { 40 TraceContext() {
41 m_currentOperation = new LogicalOperation(); 41 m_currentOperation = new LogicalOperation();
42 m_traceBound = m_currentOperation; 42 m_traceBound = m_currentOperation;
89 LogEvent(TraceEventType.OperationCompleted, "{0} {1} ms", op.Name, op.Duration); 89 LogEvent(TraceEventType.OperationCompleted, "{0} {1} ms", op.Name, op.Duration);
90 } 90 }
91 } 91 }
92 92
93 void LogEvent(TraceEventType type, string format, params object[] args) { 93 void LogEvent(TraceEventType type, string format, params object[] args) {
94 LogChannel<TraceEvent>.Default.LogEvent(TraceEvent.Create(type, format, args)); 94 LogChannel<TraceEvent>.Default.LogEvent(this, TraceEvent.Create(type, format, args));
95 } 95 }
96 } 96 }
97 } 97 }