Merge pull request #267 from jlewin/development

Swap reporting from Insights to Raygun
This commit is contained in:
Lars Brubaker 2015-05-22 15:37:58 -07:00
commit dd0cc0e4ea
3 changed files with 37 additions and 12 deletions

View file

@ -340,6 +340,14 @@
<Compile Include="PrinterControls\PrinterConnections\PrinterSetupStatus.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Mindscape.Raygun4Net, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Mindscape.Raygun4Net.5.0.0\lib\net40\Mindscape.Raygun4Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mindscape.Raygun4Net4, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Mindscape.Raygun4Net.5.0.0\lib\net40\Mindscape.Raygun4Net4.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -348,6 +356,10 @@
<HintPath>PdfSharp.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="Raygun.Diagnostics, Version=0.7.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Raygun.Diagnostics.0.7.3\lib\net45\Raygun.Diagnostics.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
@ -361,10 +373,6 @@
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="Xamarin.Insights, Version=1.10.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Xamarin.Insights.1.10.2.110\lib\portable-win+net40\Xamarin.Insights.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">

View file

@ -40,6 +40,7 @@ using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.PolygonMesh.Processors;
using MatterHackers.RenderOpenGl.OpenGl;
using MatterHackers.VectorMath;
using Mindscape.Raygun4Net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -47,7 +48,6 @@ using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using Xamarin;
namespace MatterHackers.MatterControl
{
@ -71,6 +71,8 @@ namespace MatterHackers.MatterControl
private string unableToExitTitle = "Unable to Exit".Localize();
private static RaygunClient _raygunClient = new RaygunClient("hQIlyUUZRGPyXVXbI6l1dA==");
static MatterControlApplication()
{
// Because fields on this class call localization methods and because those methods depend on the StaticData provider and because the field
@ -361,23 +363,37 @@ namespace MatterHackers.MatterControl
// Make sure we have the right working directory as we assume everything relative to the executable.
Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));
System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//throw new Exception("Forced exception thrown manually!");
Datastore.Instance.Initialize();
#if !DEBUG
// Conditionally spin up Insights reporting if not on the Stable channel
// Conditionally spin up error reporting if not on the Stable channel
string channel = UserSettings.Instance.get("UpdateFeedType");
if (string.IsNullOrEmpty(channel) || channel != "release")
if (string.IsNullOrEmpty(channel) || channel != "release" || OemSettings.Instance.WindowTitleExtra == "Experimental")
#endif
{
Insights.Initialize(
"2b84bf883521ee8deca1b633b7d33818c20b87cc",
string.Format("{0} ({1})", VersionInfo.Instance.ReleaseVersion, VersionInfo.Instance.BuildVersion),
"MatterControl Desktop");
System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
}
MatterControlApplication app = MatterControlApplication.Instance;
}
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
_raygunClient.Send(e.Exception);
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
_raygunClient.Send(e.ExceptionObject as Exception);
}
public static void WriteTestGCodeFile()
{
using (StreamWriter file = new StreamWriter("PerformanceTest.gcode"))

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Mindscape.Raygun4Net" version="5.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net45" />
<package id="Xamarin.Insights" version="1.10.2.110" targetFramework="net45" />
<package id="Raygun.Diagnostics" version="0.7.3" targetFramework="net45" />
</packages>