Example #1
0
 /// <summary>
 ///   Runs a delegate in the specified log context.
 /// </summary>
 /// <param name = "context">The context.</param>
 /// <param name = "method">The method.</param>
 public static void RunInContext(string context, MethodLogInContext method)
 {
     try
     {
         PushContext(context);
         method();
     }
     finally
     {
         PopContext();
     }
 }
Example #2
0
 /// <summary>
 ///   Runs a delegate in the specified log context.
 /// </summary>
 /// <param name = "context">The context.</param>
 /// <param name = "method">The method.</param>
 public static void RunInContext(string context, MethodLogInContext method)
 {
     try
     {
         PushContext(context);
         method();
     }
     finally
     {
         PopContext();
     }
 }