Ejemplo n.º 1
0
        private IList <string> GetFormattedStackTrace(ErrorData errorData)
        {
            if (errorData.StackTrace == null)
            {
                return(null);
            }

            var stackTrace = StackTraces.ScrubAndTruncate(errorData.StackTrace, _configurationService.Configuration.StackTraceMaximumFrames);

            return(stackTrace);
        }
Ejemplo n.º 2
0
 public static string Controller()
 {
     if (AspNetCoreHttpContext.Current != null)
     {
         var controller = Url.RouteData("controller").ToLower();
         if (!string.IsNullOrEmpty(controller))
         {
             return(controller);
         }
     }
     return(StackTraces.Class());
 }
Ejemplo n.º 3
0
 public static string Action()
 {
     if (AspNetCoreHttpContext.Current != null)
     {
         var action = Url.RouteData("action").ToLower();
         if (!string.IsNullOrEmpty(action))
         {
             return(action);
         }
     }
     return(StackTraces.Method());
 }
Ejemplo n.º 4
0
 public void ClearAll()
 {
     Transactions.Clear();
     Results.Clear();
     Commands.Clear();
     Connections.Clear();
     Contexts.Clear();
     StackTraces.Clear();
     TrafficUrls.Clear();
     TrafficWebRequests.Clear();
     ApplicationIdentities.Clear();
 }
Ejemplo n.º 5
0
 public static string Controller()
 {
     return(RouteTable.Routes.Count != 0 && HttpContext.Current != null
         ? Url.RouteData("controller").ToString().ToLower()
         : StackTraces.Class());
 }
Ejemplo n.º 6
0
 public static string Action()
 {
     return(RouteTable.Routes.Count != 0 && HttpContext.Current != null
         ? Url.RouteData("action").ToString().ToLower()
         : StackTraces.Method());
 }
Ejemplo n.º 7
0
        public void AddStackTrace()
        {
#if UNITY_EDITOR
            StackTraces.Insert(0, StackTraceEntry.Create());
#endif
        }
Ejemplo n.º 8
0
        public static VisualElement RenderStackTrace(VisualElement parent, int instanceId)
        {
            if (!AtomPreferences.IsDebugModeEnabled)
            {
                return(null);
            }
            var stackTraces = StackTraces.GetStackTraces(instanceId);

            var foldout = GetOrCreate <Foldout>(parent, "STACK_TRACES_FOLDOUT", (element) =>
            {
                element.style.marginTop    = 4;
                element.style.marginBottom = 4;
                element.text = "Stack traces";
            });

            var wrapper = GetOrCreate <VisualElement>(foldout, "STACK_TRACES_ROOT", (element) =>
            {
                element.style.flexDirection = FlexDirection.Column;
            });

            var header = GetOrCreate <VisualElement>(wrapper, "HEADER", (element) =>
            {
                element.style.flexDirection   = FlexDirection.Row;
                element.style.justifyContent  = Justify.SpaceBetween;
                element.style.alignItems      = Align.Center;
                element.style.backgroundColor = GetHeaderColor();
                element.style.paddingLeft     = 4;
                element.style.paddingRight    = 4;
                element.style.paddingTop      = 2;
                element.style.paddingBottom   = 2;
            });

            var title = GetOrCreate <Label>(header, "TITLE", (label) =>
            {
                label.text = "Overview";
                label.style.unityFontStyleAndWeight = FontStyle.Bold;
            });

            var clearButton = GetOrCreate <Button>(header, "CLEAR_BUTTON", (button) =>
            {
                button.text     = "Clear";
                button.clicked += () =>
                {
                    SetSelectedStackTraceId(instanceId, -1);
                    StackTraces.ClearStackTraces(instanceId);
                };
            });

            // All stack traces
            RenderStackTracesOverview(wrapper, stackTraces, instanceId);
            RenderStackTraceDetails(wrapper, stackTraces, instanceId);

            // Rerender on change
            stackTraces.CollectionChanged += (sender, e) =>
            {
                RenderStackTracesOverview(wrapper, stackTraces, instanceId);
                RenderStackTraceDetails(wrapper, stackTraces, instanceId);
            };

            return(wrapper);
        }
Ejemplo n.º 9
0
 private static string GetAction()
 {
     return(HasRoute()
         ? Url.RouteData("action").ToString().ToLower()
         : StackTraces.Method());
 }
Ejemplo n.º 10
0
 private static string GetController()
 {
     return(HasRoute()
         ? Url.RouteData("controller").ToString().ToLower()
         : StackTraces.Class());
 }