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

rewritten tracing
author cin
date Wed, 22 Oct 2014 18:37:56 +0400
parents
children a43745f81f10
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Implab/Diagnostics/Extensions.cs	Wed Oct 22 18:37:56 2014 +0400
@@ -0,0 +1,15 @@
+namespace Implab.Diagnostics {
+    public static class Extensions {
+        public static IPromise<T> EndLogicalOperation<T>(this IPromise<T> promise) {
+            Safe.ArgumentNotNull(promise, "promise");
+            var op = TraceContext.Instance.DetachLogicalOperation();
+
+            return promise.Anyway(() => {
+                TraceContext.Instance.EnterLogicalOperation(op,true);
+                TraceLog.EndLogicalOperation();
+                TraceContext.Instance.Leave();
+            });
+        }
+    }
+}
+