Example #1
0
 public override void OnActionExecuting(HttpActionContext context)
 {
     lock (ActionDetails.locker)
     {
         ActionDetails.ShowDetails(context);
         Console.ForegroundColor = ConsoleColor.Yellow;
         Console.WriteLine("Executing...");
         Console.ForegroundColor = ConsoleColor.White;
     }
 }
Example #2
0
 private static void LogError(HttpActionExecutedContext context, string exceptionMessage)
 {
     lock (ActionDetails.locker)
     {
         ActionDetails.ShowDetails(context.ActionContext);
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine($"Error: {exceptionMessage}");
         Console.ForegroundColor = ConsoleColor.White;
     }
 }
Example #3
0
 public override void OnActionExecuted(HttpActionExecutedContext context)
 {
     if (context.Exception == null)
     {
         lock (ActionDetails.locker)
         {
             ActionDetails.ShowDetails(context.ActionContext);
             Console.ForegroundColor = ConsoleColor.Green;
             Console.WriteLine("Success");
             Console.ForegroundColor = ConsoleColor.White;
         }
     }
 }