Example #1
0
		public void Log(Exception ex, IDictionary details, LoggingLevel level = LoggingLevel.Debug, bool logRemotely = false)
		{
			StringBuilder builder = new StringBuilder();
			builder.Append("/------------------------------------------").Append(level.ToString().ToUpper()).Append("------------------------------------------/\n");
			if (details != null && details.Count > 0)
			{
				foreach (var key in details.Keys)
				{
					builder.Append(key).Append(": ").Append(details[key].ToString()).Append("\n");
				}	
			}
			if (ex != null)
				builder.Append(ex.ToString());
			Mvx.Trace(level.ToTraceLevel(), builder.ToString());
			if (logRemotely && level >= LoggingLevel.Warning)
			{
				Xamarin.Insights.Report(ex, details, level.ToSeverity());
			}
		}