public static void Start() { if (_instance == null) { _instance = new ConsoleInterceptor(); } }
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>.")); }
public static void Stop() { _instance?.Dispose(); _instance = null; }
public ActionResult Stop() { ConsoleInterceptor.Stop(); return(Json(new { Success = true, Message = $"{nameof(ConsoleInterceptor)} now off" }, JsonRequestBehavior.AllowGet)); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { ConsoleInterceptor.SetThreadKey(); }