annotate Implab/Diagnostics/Extensions.cs @ 92:4c0e5ef99986 v2

rewritten tracing
author cin
date Wed, 22 Oct 2014 18:37:56 +0400
parents
children a43745f81f10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
1 namespace Implab.Diagnostics {
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
2 public static class Extensions {
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
3 public static IPromise<T> EndLogicalOperation<T>(this IPromise<T> promise) {
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
4 Safe.ArgumentNotNull(promise, "promise");
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
5 var op = TraceContext.Instance.DetachLogicalOperation();
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
6
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
7 return promise.Anyway(() => {
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
8 TraceContext.Instance.EnterLogicalOperation(op,true);
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
9 TraceLog.EndLogicalOperation();
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
10 TraceContext.Instance.Leave();
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
11 });
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
12 }
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
13 }
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
14 }
4c0e5ef99986 rewritten tracing
cin
parents:
diff changeset
15