Skip to content

Commit d335afe

Browse files
committed
[Core] Crash reporting service is now pluggable
1 parent f96ce6c commit d335afe

6 files changed

Lines changed: 44 additions & 64 deletions

File tree

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
path = main/external/fsharpbinding
4040
url = git://github.com/fsharp/fsharpbinding.git
4141
branch = master
42-
[submodule "main/external/raygun4net"]
43-
path = main/external/raygun4net
44-
url = git://github.com/mono/raygun4net.git
45-
branch = xshacks
4642
[submodule "main/external/sharpsvn-binary"]
4743
path = main/external/sharpsvn-binary
4844
url = git://github.com/mono/sharpsvn-binary.git

main/Main.sln

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSha
271271
EndProject
272272
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiUnit_NET_4_0", "external\guiunit\src\framework\GuiUnit_NET_4_0.csproj", "{E13A0A7B-4DE6-43ED-A139-41052D065A9B}"
273273
EndProject
274-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}"
275-
EndProject
276274
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "po", "po\po.mdproj", "{AC7D119C-980B-4712-8811-5368C14412D7}"
277275
EndProject
278276
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5D3F7E65-E55B-45CA-A83B-D1E10040281E}"
@@ -750,22 +748,6 @@ Global
750748
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU
751749
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU
752750
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU
753-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
754-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
755-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU
756-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU
757-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
758-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
759-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
760-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
761-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
762-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU
763-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU
764-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU
765-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU
766-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU
767-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU
768-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU
769751
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
770752
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
771753
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU
@@ -1385,15 +1367,6 @@ Global
13851367
{ABB21D58-6EFA-49EA-9555-EDDEC8123DD6}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU
13861368
{ABB21D58-6EFA-49EA-9555-EDDEC8123DD6}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU
13871369
{ABB21D58-6EFA-49EA-9555-EDDEC8123DD6}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU
1388-
{AC7D119C-980B-4712-8811-5368C14412D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1389-
{AC7D119C-980B-4712-8811-5368C14412D7}.DebugGnome|Any CPU.ActiveCfg = DebugGnome|Any CPU
1390-
{AC7D119C-980B-4712-8811-5368C14412D7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
1391-
{AC7D119C-980B-4712-8811-5368C14412D7}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
1392-
{AC7D119C-980B-4712-8811-5368C14412D7}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
1393-
{AC7D119C-980B-4712-8811-5368C14412D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
1394-
{AC7D119C-980B-4712-8811-5368C14412D7}.ReleaseGnome|Any CPU.ActiveCfg = ReleaseGnome|Any CPU
1395-
{AC7D119C-980B-4712-8811-5368C14412D7}.ReleaseMac|Any CPU.ActiveCfg = ReleaseMac|Any CPU
1396-
{AC7D119C-980B-4712-8811-5368C14412D7}.ReleaseWin32|Any CPU.ActiveCfg = ReleaseWin32|Any CPU
13971370
{ADDC9D20-83C5-4245-9B46-2C5F6642CFBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13981371
{ADDC9D20-83C5-4245-9B46-2C5F6642CFBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
13991372
{ADDC9D20-83C5-4245-9B46-2C5F6642CFBC}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU
@@ -2029,7 +2002,6 @@ Global
20292002
{B8897B76-1A12-4DFA-8B60-7944CC4C9654} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
20302003
{2D711139-8765-4929-BC7A-AA2DEE6F615D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
20312004
{E13A0A7B-4DE6-43ED-A139-41052D065A9B} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
2032-
{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
20332005
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
20342006
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
20352007
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}

main/external/raygun4net

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//
2+
// CrashReporter.cs
3+
//
4+
// Author:
5+
// Lluis Sanchez Gual <lluis@xamarin.com>
6+
//
7+
// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
8+
//
9+
// Permission is hereby granted, free of charge, to any person obtaining a copy
10+
// of this software and associated documentation files (the "Software"), to deal
11+
// in the Software without restriction, including without limitation the rights
12+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
// copies of the Software, and to permit persons to whom the Software is
14+
// furnished to do so, subject to the following conditions:
15+
//
16+
// The above copyright notice and this permission notice shall be included in
17+
// all copies or substantial portions of the Software.
18+
//
19+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
// THE SOFTWARE.
26+
27+
using System;
28+
using Mono.Addins;
29+
using System.Collections.Generic;
30+
31+
namespace MonoDevelop.Core.LogReporting
32+
{
33+
[TypeExtensionPoint]
34+
public abstract class CrashReporter
35+
{
36+
public abstract void ReportCrash (Exception ex, bool willShutDown, IEnumerable<string> tags);
37+
}
38+
}
39+

main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@
472472
<Compile Include="MonoDevelop.Projects\IDotNetFileContainer.cs" />
473473
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\IMSBuildGlobalPropertyProvider.cs" />
474474
<Compile Include="MonoDevelop.Projects\DotNetProjectImport.cs" />
475+
<Compile Include="MonoDevelop.Core.LogReporting\CrashReporter.cs" />
475476
</ItemGroup>
476477
<ItemGroup>
477478
<None Include="Makefile.am" />
@@ -559,10 +560,6 @@
559560
<Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>
560561
<Name>ICSharpCode.NRefactory.Cecil</Name>
561562
</ProjectReference>
562-
<ProjectReference Include="..\..\..\external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj">
563-
<Project>{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}</Project>
564-
<Name>Mindscape.Raygun4Net</Name>
565-
</ProjectReference>
566563
</ItemGroup>
567564
<ItemGroup>
568565
<Content Include="MonoDevelop.Core.dll.config">

main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
using System.IO;
3333
using System.Linq;
3434
using System.Diagnostics;
35+
using Mono.Addins;
36+
using MonoDevelop.Core.LogReporting;
3537

3638
#if ENABLE_RAYGUN
3739
using System.Threading;
@@ -49,9 +51,6 @@ public static class LoggingService
4951
const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
5052
const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
5153

52-
#if ENABLE_RAYGUN
53-
static RaygunClient raygunClient;
54-
#endif
5554
static List<ILogger> loggers = new List<ILogger> ();
5655
static RemoteLogger remoteLogger;
5756
static DateTime timestamp;
@@ -102,13 +101,6 @@ static LoggingService ()
102101

103102
timestamp = DateTime.Now;
104103

105-
#if ENABLE_RAYGUN
106-
string raygunKey = BrandingService.GetString ("RaygunApiKey");
107-
if (raygunKey != null) {
108-
raygunClient = new RaygunClient (raygunKey);
109-
}
110-
#endif
111-
112104
//remove the default trace listener on .NET, it throws up horrible dialog boxes for asserts
113105
Debug.Listeners.Clear ();
114106

@@ -215,22 +207,8 @@ internal static void ReportUnhandledException (Exception ex, bool willShutDown,
215207
if (ReportCrashes.HasValue && !ReportCrashes.Value)
216208
return;
217209

218-
var customData = new Hashtable ();
219-
foreach (var cd in SystemInformation.GetDescription ())
220-
customData[cd.Title ?? ""] = cd.Description;
221-
222-
#if ENABLE_RAYGUN
223-
if (raygunClient != null) {
224-
ThreadPool.QueueUserWorkItem (delegate {
225-
try {
226-
raygunClient.Send (ex, tags, customData, Runtime.Version.ToString ());
227-
} catch {
228-
// If we get here then things have gone really wrong - we can't log anything or
229-
// attempt to report anything. Drop any exception that ends up here.
230-
}
231-
});
232-
}
233-
#endif
210+
foreach (var cr in AddinManager.GetExtensionObjects<CrashReporter> (true))
211+
cr.ReportCrash (ex, willShutDown, tags);
234212

235213
//ensure we don't lose the setting
236214
if (ReportCrashes != oldReportCrashes) {
@@ -549,5 +527,4 @@ public static void LogFatalError (string message, Exception ex)
549527

550528
#endregion
551529
}
552-
553530
}

0 commit comments

Comments
 (0)