/// <summary> /// Convert custom user attributes /// </summary> /// <param name="report">Received report</param> /// <param name="clientAttributes">Client's attributes (report and client)</param> /// <returns>Dictionary of custom user attributes </returns> private void ConvertAttributes(BacktraceReport report, Dictionary <string, object> clientAttributes) { var attributes = BacktraceReport.ConcatAttributes(report, clientAttributes); foreach (var attribute in attributes) { if (attribute.Value == null) { continue; } var type = attribute.Value.GetType(); if (type.IsPrimitive || type == typeof(string) || type.IsEnum) { Attributes.Add(attribute.Key, attribute.Value); } else { ComplexAttributes.Add(attribute.Key, attribute.Value); } } //add exception information to Complex attributes. if (report.ExceptionTypeReport) { ComplexAttributes.Add("Exception Properties", report.Exception); } }
/// <summary> /// Convert custom user attributes /// </summary> /// <param name="report">Received report</param> /// <param name="clientAttributes">Client's attributes (report and client)</param> /// <returns>Dictionary of custom user attributes </returns> private void ConvertAttributes(BacktraceReport report, Dictionary <string, string> clientAttributes) { var reportAttributes = BacktraceReport.ConcatAttributes(report, clientAttributes); foreach (var attribute in reportAttributes) { Attributes[attribute.Key] = attribute.Value; } }