Пример #1
0
 public static void Start()
 {
     if (_instance == null)
     {
         _instance = new ConsoleInterceptor();
     }
 }
Пример #2
0
        public ActionResult GetLogs(string key)
        {
            var interceptor = ConsoleInterceptor.GetInterceptor();

            return(Content(interceptor?.GetAllText(key)
                           ?? $"ConsoleInterceptor is off. Turn it on via <a href='{this.Url.Action("Start", "Log", new { }, this.Request.Url.Scheme)}'>here</a>."));
        }
Пример #3
0
 public static void Stop()
 {
     _instance?.Dispose();
     _instance = null;
 }
Пример #4
0
 public ActionResult Stop()
 {
     ConsoleInterceptor.Stop();
     return(Json(new { Success = true, Message = $"{nameof(ConsoleInterceptor)} now off" }, JsonRequestBehavior.AllowGet));
 }
Пример #5
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     ConsoleInterceptor.SetThreadKey();
 }