示例#1
0
        /// <summary>
        /// Convert Backtrace data to JSON
        /// </summary>
        /// <returns>Backtrace Data JSON string</returns>
        public string ToJson()
        {
            var json = new BacktraceJObject
            {
                { "uuid", Uuid },
                { "timestamp", Timestamp },
                { "lang", Lang },
                { "langVersion", LangVersion },
                { "agent", Agent },
                { "agentVersion", AgentVersion },
                { "mainThread", MainThread },
                { "classifiers", new JArray(Classifier) },
                { "attributes", Attributes.ToJson() },
                { "annotations", Annotation.ToJson() },
                { "threads", ThreadData == null ? null : ThreadData.ToJson() }
            };

            return(json.ToString());
        }
示例#2
0
        public string ToJson()
        {
            var json = new BacktraceJObject
            {
                ["uuid"]         = Uuid,
                ["timestamp"]    = Timestamp,
                ["lang"]         = "csharp",
                ["langVersion"]  = "Unity",
                ["agent"]        = "backtrace-unity",
                ["agentVersion"] = "1.0.0",
                ["mainThread"]   = MainThread,
                ["classifiers"]  = new JArray(Classifier),
                ["attributes"]   = _attributes.ToJson(),
                ["annotations"]  = _annotations.ToJson(),
                ["threads"]      = _threadData?.ToJson()
            };

            return(json.ToString());
        }