Last active
August 29, 2015 14:14
-
-
Save Clancey/4e13c61adab63db4b219 to your computer and use it in GitHub Desktop.
Insights Logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Log (Exception ex, ReportSeverity severity= ReportSeverity.Error, | |
[CallerMemberName] string memberName = "", | |
[CallerFilePath] string sourceFilePath = "", | |
[CallerLineNumber] int sourceLineNumber = 0) | |
{ | |
try{ | |
Console.WriteLine (ex); | |
Console.WriteLine("{0} - {1} - {2} \r\n {3}",sourceFilePath,memberName,sourceLineNumber,ex); | |
Insights.Report (ex, new Dictionary<string,object>{ | |
{"Method",memberName}, | |
{"File Name",sourceFilePath}, | |
{"Line Number",sourceLineNumber}, | |
}, severity); | |
} catch (Exception ex1) { | |
Console.WriteLine (ex1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment