Esempio n. 1
0
        /// <summary>
        /// Concat two attributes dictionary
        /// </summary>
        /// <param name="report">Current report</param>
        /// <param name="attributes">Attributes to concatenate</param>
        /// <returns></returns>
        internal static Dictionary <string, string> ConcatAttributes(
            BacktraceReport report, Dictionary <string, string> attributes)
        {
            var reportAttributes = report.Attributes;

            return(reportAttributes.Merge(attributes));
        }
Esempio n. 2
0
 /// <summary>
 /// Set result when client rate limit reached
 /// </summary>
 /// <param name="report">Executed report</param>
 /// <returns>BacktraceResult with limit reached information</returns>
 internal static BacktraceResult OnLimitReached(BacktraceReport report)
 {
     return(new BacktraceResult()
     {
         BacktraceReport = report,
         Status = BacktraceResultStatus.LimitReached,
         Message = "Client report limit reached"
     });
 }
Esempio n. 3
0
 /// <summary>
 /// Set result when error occurs while sending data to API
 /// </summary>
 /// <param name="report">Executed report</param>
 /// <param name="exception">Exception</param>
 /// <returns>BacktraceResult with exception information</returns>
 internal static BacktraceResult OnError(BacktraceReport report, Exception exception)
 {
     return(new BacktraceResult()
     {
         BacktraceReport = report,
         Message = exception.Message,
         Status = BacktraceResultStatus.ServerError
     });
 }
Esempio n. 4
0
 /// <summary>
 /// Create instance of report data
 /// </summary>
 /// <param name="report">Current report</param>
 /// <param name="clientAttributes">BacktraceClient's attributes</param>
 public BacktraceData(BacktraceReport report, Dictionary <string, object> clientAttributes)
 {
     if (report == null)
     {
         return;
     }
     Report = report;
     SetReportInformation();
     SetAttributes(clientAttributes);
     SetThreadInformations();
     Attachments = Report.AttachmentPaths.Distinct().ToList();
 }
Esempio n. 5
0
        /// <summary>
        /// Concat two attributes dictionary
        /// </summary>
        /// <param name="report">Current report</param>
        /// <param name="attributes">Attributes to concatenate</param>
        /// <returns></returns>
        internal static Dictionary <string, object> ConcatAttributes(
            BacktraceReport report, Dictionary <string, object> attributes)
        {
            var reportAttributes = report.Attributes;

            if (attributes == null)
            {
                return(reportAttributes);
            }
            ;
            return(reportAttributes.Merge(attributes));
        }
Esempio n. 6
0
        public BacktraceUnityMessage(BacktraceReport report)
        {
            if (report == null)
            {
                throw new ArgumentException("report");
            }
            _backtraceFrame = true;
            Message         = report.Message;

            if (report.ExceptionTypeReport)
            {
                Type       = LogType.Exception;
                StackTrace = report.Exception.StackTrace;
            }
            else
            {
                StackTrace = string.Empty;
                Type       = LogType.Warning;
            }
        }
Esempio n. 7
0
        public BacktraceUnityMessage(BacktraceReport report)
        {
            if (report == null)
            {
                throw new ArgumentException("report");
            }
            Message = report.Message;

            if (report.ExceptionTypeReport)
            {
                Type              = LogType.Exception;
                StackTrace        = GetFormattedStackTrace(report.Exception.StackTrace);
                _formattedMessage = GetFormattedMessage(true);
            }
            else
            {
                StackTrace        = string.Empty;
                Type              = LogType.Warning;
                _formattedMessage = GetFormattedMessage(true);
            }
        }
Esempio n. 8
0
 /// <summary>
 /// Enqueue user message
 /// </summary>
 /// <param name="report">Backtrace reprot</param>
 /// <returns>Message stored in the log manager</returns>
 public bool Enqueue(BacktraceReport report)
 {
     return(Enqueue(new BacktraceUnityMessage(report)));
 }