예제 #1
0
파일: Logger.cs 프로젝트: fadafido/tojeero
		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());
			}
		}