/// <summary> /// Allow user to report an exception even though the program doesn't need to exit /// </summary> public static void ReportNonFatalException(Exception exception, IRepeatNoticePolicy policy) { if (s_justRecordNonFatalMessagesForTesting) { ErrorReport.s_previousNonFatalException = exception; return; } _errorReporter.ReportNonFatalException(exception, policy); UsageReporter.ReportException(false, null, exception, null); }
/// <summary> /// /// </summary> /// <example> /// UsageReporter.Init(Settings.Default.Reporting, "myproduct.org", "UA-11111111-2", ///#if DEBUG /// true ///#else /// false ///#endif /// ); /// </example> /// <param name="settings"></param> /// <param name="domain"></param> /// <param name="googleAnalyticsAccountCode"></param> /// <param name="reportAsDeveloper">Normally this is true for DEBUG builds. It is separated out here because sometimes a developer /// uses a Release build of Palaso.dll, but would still want his/her activities logged as a developer.</param> public static void Init(ReportingSettings settings, string domain, string googleAnalyticsAccountCode, bool reportAsDeveloper) { s_singleton = new UsageReporter(); s_singleton._settings = settings; s_singleton._realPreviousVersion = settings.PreviousVersion; s_singleton._settings.Launches++; s_singleton.BeginGoogleAnalytics(domain, googleAnalyticsAccountCode, reportAsDeveloper); settings.PreviousVersion = ErrorReport.VersionNumberString; settings.PreviousLaunchDate = DateTime.Now.Date; s_singleton._mostRecentArea = "Initializing"; // Seems more useful to put in something in case an error occurs before app gets this set. }
public static void NotifyUserOfProblem(IRepeatNoticePolicy policy, Exception error, string messageFmt, params object[] args) { var result = NotifyUserOfProblem(policy, "Details", ErrorResult.Yes, messageFmt, args); if (result == ErrorResult.Yes) { OnShowDetails(error, string.Format(messageFmt, args)); } UsageReporter.ReportException(false, null, error, String.Format(messageFmt, args)); }
/// <summary> /// /// </summary> /// <example> /// UsageReporter.Init(Settings.Default.Reporting, "myproduct.org", "UA-11111111-2", ///#if DEBUG /// true ///#else /// false ///#endif /// ); /// </example> /// <param name="settings"></param> /// <param name="domain"></param> /// <param name="googleAnalyticsAccountCode"></param> /// <param name="reportAsDeveloper">Normally this is true for DEBUG builds. It is separated out here because sometimes a developer /// uses a Release build of Palaso.dll, but would still want his/her activities logged as a developer.</param> public static void Init(ReportingSettings settings, string domain, string googleAnalyticsAccountCode, bool reportAsDeveloper) { s_singleton = new UsageReporter(); s_singleton._settings = settings; s_singleton._realPreviousVersion = settings.PreviousVersion; s_singleton._settings.Launches++; s_singleton.BeginGoogleAnalytics(domain, googleAnalyticsAccountCode, reportAsDeveloper); settings.PreviousVersion = ErrorReport.VersionNumberString; settings.PreviousLaunchDate = DateTime.Now.Date; s_singleton._mostRecentArea = "Initializing"; // Seems more useful to put in something in case an error occurs before app gets this set. }
public static void ReportFatalException(Exception error) { UsageReporter.ReportException(true, null, error, null); _errorReporter.ReportFatalException(error); }