Skip to content

Commit 64a67a6

Browse files
committed
Renamed StackingInfo to ManualStackingInfo
1 parent 276e9ee commit 64a67a6

File tree

8 files changed

+38
-14
lines changed

8 files changed

+38
-14
lines changed

Source/Samples/SampleMvc/Controllers/HomeController.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Threading;
34
using System.Web;
45
using System.Web.Mvc;
@@ -32,6 +33,23 @@ public ViewResult Error() {
3233
public ViewResult CustomError() {
3334
return View("CustomError");
3435
}
36+
37+
[HttpGet]
38+
public ViewResult ManualStacking() {
39+
ExceptionlessClient.Default.CreateLog(nameof(HomeController), "Random Log message")
40+
.SetManualStackingInfo("Manual Stacked Log Messages", new Dictionary<string, string> {
41+
{ "Controller", nameof(HomeController) },
42+
{ "Action", nameof(ManualStacking) }
43+
})
44+
.Submit();
45+
46+
try {
47+
throw new Exception(Guid.NewGuid().ToString());
48+
} catch (Exception ex) {
49+
ex.ToExceptionless().SetManualStackingKey(nameof(HomeController)).Submit();
50+
throw;
51+
}
52+
}
3553

3654
[HttpGet]
3755
public ViewResult FourZeroFour() {

Source/Samples/SampleMvc/Controllers/ValuesController.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ namespace Exceptionless.SampleMvc.Controllers {
66
public class ValuesController : ApiController {
77
// GET api/values
88
public IEnumerable<string> Get() {
9-
throw new ApplicationException("WebApi GET error");
9+
try {
10+
throw new ApplicationException("WebApi GET error");
11+
} catch (Exception ex) {
12+
ex.ToExceptionless().Submit();
13+
throw;
14+
}
1015
}
1116

1217
// GET api/values/5

Source/Samples/SampleMvc/Views/Home/Index.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@Html.ActionLink("Boom!", "Boom")
44
@Html.ActionLink("Custom Boom!", "CustomBoom")
55
@Html.ActionLink("Boom 25!", "Boom25")
6+
@Html.ActionLink("Manual Stacking", "ManualStacking")
67

78
<a href="javascript:doAjax()">Ajax Boom</a>
89

Source/Shared/Exceptionless.Portable.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<Compile Include="Dependency\TinyIoC.cs" />
6161
<Compile Include="Events\EventSubmissionEventArgsBase.cs" />
6262
<Compile Include="Events\EventSubmittedEventArgs.cs" />
63-
<Compile Include="Models\Client\Data\StackingInfo.cs" />
63+
<Compile Include="Models\Client\Data\ManualStackingInfo.cs" />
6464
<Compile Include="Plugins\Default\025_SessionIdManagementPlugin.cs" />
6565
<Compile Include="Plugins\Default\030_DuplicateCheckerPlugin.cs" />
6666
<Compile Include="Plugins\ContextData.cs" />

Source/Shared/Extensions/EventExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public static void SetManualStackingInfo(this Event ev, IDictionary<string, stri
289289
if (signatureData == null || signatureData.Count == 0)
290290
return;
291291

292-
ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(signatureData);
292+
ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(signatureData);
293293
}
294294

295295
/// <summary>
@@ -302,7 +302,7 @@ public static void SetManualStackingInfo(this Event ev, string title, IDictionar
302302
if (String.IsNullOrWhiteSpace(title) || signatureData == null || signatureData.Count == 0)
303303
return;
304304

305-
ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, signatureData);
305+
ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(title, signatureData);
306306
}
307307

308308
/// <summary>
@@ -314,7 +314,7 @@ public static void SetManualStackingKey(this Event ev, string manualStackingKey)
314314
if (String.IsNullOrWhiteSpace(manualStackingKey))
315315
return;
316316

317-
ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(null, new Dictionary<string, string> { { "ManualStackingKey", manualStackingKey } });
317+
ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(null, new Dictionary<string, string> { { "ManualStackingKey", manualStackingKey } });
318318
}
319319

320320
/// <summary>
@@ -327,7 +327,7 @@ public static void SetManualStackingKey(this Event ev, string title, string manu
327327
if (String.IsNullOrWhiteSpace(title) || String.IsNullOrWhiteSpace(manualStackingKey))
328328
return;
329329

330-
ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, new Dictionary<string, string> { { "ManualStackingKey", manualStackingKey } });
330+
ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(title, new Dictionary<string, string> { { "ManualStackingKey", manualStackingKey } });
331331
}
332332

333333
public static T GetDataValue<T>(this Event ev, string key, IJsonSerializer serializer = null) {

Source/Shared/Models/Client/Data/StackingInfo.cs renamed to Source/Shared/Models/Client/Data/ManualStackingInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
using Exceptionless.Extensions;
44

55
namespace Exceptionless.Models.Data {
6-
public class StackingInfo {
7-
public StackingInfo() {
6+
public class ManualStackingInfo {
7+
public ManualStackingInfo() {
88
SignatureData = new Dictionary<string, string>();
99
}
1010

11-
public StackingInfo(string title) : this() {
11+
public ManualStackingInfo(string title) : this() {
1212
if (!String.IsNullOrWhiteSpace(title))
1313
Title = title.Trim();
1414
}
1515

16-
public StackingInfo(string title, IDictionary<string, string> signatureData) : this(title) {
16+
public ManualStackingInfo(string title, IDictionary<string, string> signatureData) : this(title) {
1717
if (signatureData != null && signatureData.Count > 0)
1818
SignatureData.AddRange(signatureData);
1919
}
2020

21-
public StackingInfo(IDictionary<string, string> signatureData) : this(null, signatureData) {}
21+
public ManualStackingInfo(IDictionary<string, string> signatureData) : this(null, signatureData) {}
2222

2323
/// <summary>
2424
/// Stack Title (defaults to the event message)

Source/Shared/Models/Client/Event.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static class KnownDataKeys {
7878
public const string Version = "@version";
7979
public const string Level = "@level";
8080
public const string SubmissionMethod = "@submission_method";
81-
public const string StackingInfo = "@stack";
81+
public const string ManualStackingInfo = "@stack";
8282
}
8383
}
8484
}

Source/Tests/Plugins/PluginTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void ConfigurationDefaults_SerializedProperties() {
6666
client.Configuration.DefaultData.Add(Event.KnownDataKeys.EnvironmentInfo, new EnvironmentInfo { MachineName = "blake" });
6767
client.Configuration.DefaultData.Add(Event.KnownDataKeys.Error, new Error { Message = "blake" });
6868
client.Configuration.DefaultData.Add(Event.KnownDataKeys.Level, "Debug");
69-
client.Configuration.DefaultData.Add(Event.KnownDataKeys.StackingInfo, "blake");
69+
client.Configuration.DefaultData.Add(Event.KnownDataKeys.ManualStackingInfo, "blake");
7070
client.Configuration.DefaultData.Add(Event.KnownDataKeys.RequestInfo, new RequestInfo { Host = "blake" });
7171
client.Configuration.DefaultData.Add(Event.KnownDataKeys.SimpleError, new SimpleError { Message = "blake" });
7272
client.Configuration.DefaultData.Add(Event.KnownDataKeys.SubmissionMethod, "test");
@@ -87,7 +87,7 @@ public void ConfigurationDefaults_SerializedProperties() {
8787
Assert.Equal("blake", context.Event.GetError().Message);
8888
Assert.Equal("blake", context.Event.GetError(serializer).Message);
8989
Assert.Equal("Debug", context.Event.Data[Event.KnownDataKeys.Level]);
90-
Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.StackingInfo]);
90+
Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.ManualStackingInfo]);
9191
Assert.True(context.Event.Data[Event.KnownDataKeys.RequestInfo] is string);
9292
Assert.Equal("blake", context.Event.GetRequestInfo().Host);
9393
Assert.Equal("blake", context.Event.GetRequestInfo(serializer).Host);

0 commit comments

Comments
 (0)