Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### BREAKING CHANGES

- `BreadcrumbLevel.Critical` has been renamed to `BreadcrumbLevel.Fatal` for consistency with the other Sentry SDKs ([#4605](https://github.com/getsentry/sentry-dotnet/pull/4605))
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606))
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BreadcrumbOverheadBenchmarks
{
{ Message, Type }
};
private const BreadcrumbLevel Level = BreadcrumbLevel.Critical;
private const BreadcrumbLevel Level = BreadcrumbLevel.Fatal;

private IDisposable _sdk;

Expand Down
2 changes: 1 addition & 1 deletion samples/Sentry.Samples.Console.Customized/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ await SentrySdk.ConfigureScopeAsync(async scope =>
const string replaceBreadcrumb = "don't trust this breadcrumb";
if (hint.Items.TryGetValue(replaceBreadcrumb, out var replacementMessage))
{
return new Breadcrumb((string)replacementMessage, null, null, null, BreadcrumbLevel.Critical);
return new Breadcrumb((string)replacementMessage, null, null, null, BreadcrumbLevel.Fatal);
}

return crumb;
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Extensions.Logging/LogLevelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static BreadcrumbLevel ToBreadcrumbLevel(this LogLevel level)
LogLevel.Information => BreadcrumbLevel.Info,
LogLevel.Warning => BreadcrumbLevel.Warning,
LogLevel.Error => BreadcrumbLevel.Error,
LogLevel.Critical => BreadcrumbLevel.Critical,
LogLevel.Critical => BreadcrumbLevel.Fatal,
_ => (BreadcrumbLevel)level
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Log4Net/LevelMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static class LevelMapping
{
return loggingLevel.Level switch
{
var l when l == Level.Fatal || l == Level.Emergency => BreadcrumbLevel.Critical,
var l when l == Level.Fatal || l == Level.Emergency => BreadcrumbLevel.Fatal,
var l when l == Level.Alert || l == Level.Critical || l == Level.Severe || l == Level.Error => BreadcrumbLevel.Error,
var l when l == Level.Warn => BreadcrumbLevel.Warning,
var l when l == Level.Notice || l == Level.Info => BreadcrumbLevel.Info,
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.NLog/LogLevelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static BreadcrumbLevel ToBreadcrumbLevel(this LogLevel level)
{
nameof(LogLevel.Debug) => BreadcrumbLevel.Debug,
nameof(LogLevel.Error) => BreadcrumbLevel.Error,
nameof(LogLevel.Fatal) => BreadcrumbLevel.Critical,
nameof(LogLevel.Fatal) => BreadcrumbLevel.Fatal,
nameof(LogLevel.Info) => BreadcrumbLevel.Info,
nameof(LogLevel.Trace) => BreadcrumbLevel.Debug,
nameof(LogLevel.Warn) => BreadcrumbLevel.Warning,
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Serilog/LogLevelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static BreadcrumbLevel ToBreadcrumbLevel(this LogEventLevel level)
LogEventLevel.Information => BreadcrumbLevel.Info,
LogEventLevel.Warning => BreadcrumbLevel.Warning,
LogEventLevel.Error => BreadcrumbLevel.Error,
LogEventLevel.Fatal => BreadcrumbLevel.Critical,
LogEventLevel.Fatal => BreadcrumbLevel.Fatal,
_ => (BreadcrumbLevel)level
};
}
Expand Down
5 changes: 3 additions & 2 deletions src/Sentry/Breadcrumb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ public static Breadcrumb FromJson(JsonElement json)
"INFO" => BreadcrumbLevel.Info,
"WARNING" => BreadcrumbLevel.Warning,
"ERROR" => BreadcrumbLevel.Error,
"CRITICAL" => BreadcrumbLevel.Critical,
"FATAL" => BreadcrumbLevel.Critical,
// Renamed in v6 but kept here to avoid issues with cached envelopes. Can be safely removed in the future.
"CRITICAL" => BreadcrumbLevel.Fatal,
"FATAL" => BreadcrumbLevel.Fatal,
_ => default
};
return new Breadcrumb(timestamp, message, type, data!, category, level);
Expand Down
6 changes: 3 additions & 3 deletions src/Sentry/BreadcrumbLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public enum BreadcrumbLevel
Error = 2,

/// <summary>
/// Critical breadcrumb level.
/// Fatal breadcrumb level.
/// </summary>
[EnumMember(Value = "critical")]
Critical = 3,
[EnumMember(Value = "fatal")]
Fatal = 3,
}
2 changes: 1 addition & 1 deletion src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ private void AddBreadcrumbForException(SentryEvent evt, Scope scope)
{"exception_message", exceptionMessage}
};
}
scope.AddBreadcrumb(breadcrumbMessage, "Exception", data: data, level: BreadcrumbLevel.Critical);
scope.AddBreadcrumb(breadcrumbMessage, "Exception", data: data, level: BreadcrumbLevel.Fatal);
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/Platforms/Android/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static BreadcrumbLevel ToBreadcrumbLevel(this JavaSdk.SentryLevel level)
"INFO" => BreadcrumbLevel.Info,
"WARNING" => BreadcrumbLevel.Warning,
"ERROR" => BreadcrumbLevel.Error,
"FATAL" => BreadcrumbLevel.Critical,
"FATAL" => BreadcrumbLevel.Fatal,
_ => throw new ArgumentOutOfRangeException(nameof(level), level.Name(), message: default)
};

Expand All @@ -42,7 +42,7 @@ public static JavaSdk.SentryLevel ToJavaSentryLevel(this BreadcrumbLevel level)
BreadcrumbLevel.Info => JavaSdk.SentryLevel.Info,
BreadcrumbLevel.Warning => JavaSdk.SentryLevel.Warning,
BreadcrumbLevel.Error => JavaSdk.SentryLevel.Error,
BreadcrumbLevel.Critical => JavaSdk.SentryLevel.Fatal,
BreadcrumbLevel.Fatal => JavaSdk.SentryLevel.Fatal,
_ => throw new ArgumentOutOfRangeException(nameof(level), level, message: default)
};

Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/Platforms/Cocoa/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static BreadcrumbLevel ToBreadcrumbLevel(this CocoaSdk.SentryLevel level)
CocoaSdk.SentryLevel.Info => BreadcrumbLevel.Info,
CocoaSdk.SentryLevel.Warning => BreadcrumbLevel.Warning,
CocoaSdk.SentryLevel.Error => BreadcrumbLevel.Error,
CocoaSdk.SentryLevel.Fatal => BreadcrumbLevel.Critical,
CocoaSdk.SentryLevel.Fatal => BreadcrumbLevel.Fatal,
_ => throw new ArgumentOutOfRangeException(nameof(level), level, null)
};

Expand All @@ -33,7 +33,7 @@ public static CocoaSdk.SentryLevel ToCocoaSentryLevel(this BreadcrumbLevel level
BreadcrumbLevel.Info => CocoaSdk.SentryLevel.Info,
BreadcrumbLevel.Warning => CocoaSdk.SentryLevel.Warning,
BreadcrumbLevel.Error => CocoaSdk.SentryLevel.Error,
BreadcrumbLevel.Critical => CocoaSdk.SentryLevel.Fatal,
BreadcrumbLevel.Fatal => CocoaSdk.SentryLevel.Fatal,
_ => throw new ArgumentOutOfRangeException(nameof(level), level, message: default)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
Message: my exception,
Category: Exception,
Level: critical
Level: fatal
}
],
Spans: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static IEnumerable<object[]> BreadcrumbTestCases()
yield return new object[] { (BreadcrumbLevel.Info, LogLevel.Information) };
yield return new object[] { (BreadcrumbLevel.Warning, LogLevel.Warning) };
yield return new object[] { (BreadcrumbLevel.Error, LogLevel.Error) };
yield return new object[] { (BreadcrumbLevel.Critical, LogLevel.Critical) };
yield return new object[] { (BreadcrumbLevel.Fatal, LogLevel.Critical) };
yield return new object[] { ((BreadcrumbLevel)6, LogLevel.None) };
yield return new object[] { ((BreadcrumbLevel)int.MaxValue, (LogLevel)int.MaxValue) };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace Sentry
Warning = 1,
[System.Runtime.Serialization.EnumMember(Value="error")]
Error = 2,
[System.Runtime.Serialization.EnumMember(Value="critical")]
Critical = 3,
[System.Runtime.Serialization.EnumMember(Value="fatal")]
Fatal = 3,
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace Sentry
Warning = 1,
[System.Runtime.Serialization.EnumMember(Value="error")]
Error = 2,
[System.Runtime.Serialization.EnumMember(Value="critical")]
Critical = 3,
[System.Runtime.Serialization.EnumMember(Value="fatal")]
Fatal = 3,
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace Sentry
Warning = 1,
[System.Runtime.Serialization.EnumMember(Value="error")]
Error = 2,
[System.Runtime.Serialization.EnumMember(Value="critical")]
Critical = 3,
[System.Runtime.Serialization.EnumMember(Value="fatal")]
Fatal = 3,
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace Sentry
Warning = 1,
[System.Runtime.Serialization.EnumMember(Value="error")]
Error = 2,
[System.Runtime.Serialization.EnumMember(Value="critical")]
Critical = 3,
[System.Runtime.Serialization.EnumMember(Value="fatal")]
Fatal = 3,
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/Extensibility/HubAdapterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void TestAddBreadcrumbExtension(
{"Key", "value"},
{"Key2", "value2"},
};
const BreadcrumbLevel level = BreadcrumbLevel.Critical;
const BreadcrumbLevel level = BreadcrumbLevel.Fatal;

var scope = new Scope();
Hub.SubstituteConfigureScope(scope);
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/HubExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void AddBreadcrumb_AllFields_CreatesBreadcrumb()
{"Key", null},
{"Key2", "value2"},
};
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Critical;
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Fatal;

Sut.AddBreadcrumb(
clock,
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.Tests/HubTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void CaptureEvent_Exception_LeavesBreadcrumb(bool withScopeCallback)
using var assertionScope = new AssertionScope();
var breadcrumb = scope.Breadcrumbs.Last();
breadcrumb.Message.Should().Be(evt.Exception!.Message);
breadcrumb.Level.Should().Be(BreadcrumbLevel.Critical);
breadcrumb.Level.Should().Be(BreadcrumbLevel.Fatal);
breadcrumb.Category.Should().Be("Exception");
}

Expand Down Expand Up @@ -342,7 +342,7 @@ public void CaptureEvent_WithMessageAndException_StoresExceptionMessageAsData()
{
["exception_message"] = evt.Exception!.Message
});
breadcrumb.Level.Should().Be(BreadcrumbLevel.Critical);
breadcrumb.Level.Should().Be(BreadcrumbLevel.Fatal);
breadcrumb.Category.Should().Be("Exception");
}

Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/Protocol/BreadcrumbTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ public static IEnumerable<object[]> TestCases()
yield return new object[] { (new Breadcrumb(DateTimeOffset.MaxValue, type: "type"), """{"timestamp":"9999-12-31T23:59:59.999Z","type":"type"}""") };
yield return new object[] { (new Breadcrumb(DateTimeOffset.MaxValue, data: new Dictionary<string, string> { { "key", "val" } }), """{"timestamp":"9999-12-31T23:59:59.999Z","data":{"key":"val"}}""") };
yield return new object[] { (new Breadcrumb(DateTimeOffset.MaxValue, category: "category"), """{"timestamp":"9999-12-31T23:59:59.999Z","category":"category"}""") };
yield return new object[] { (new Breadcrumb(DateTimeOffset.MaxValue, level: BreadcrumbLevel.Critical), """{"timestamp":"9999-12-31T23:59:59.999Z","level":"critical"}""") };
yield return new object[] { (new Breadcrumb(DateTimeOffset.MaxValue, level: BreadcrumbLevel.Fatal), """{"timestamp":"9999-12-31T23:59:59.999Z","level":"fatal"}""") };
}
}
6 changes: 3 additions & 3 deletions test/Sentry.Tests/Protocol/ScopeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void AddBreadcrumb_ValueTuple_AllArgumentsMatch()
const string expectedCategory = "original Category";
const string expectedType = "original Type";
var expectedData = (key: "key", value: "value");
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Critical;
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Fatal;

var sut = _fixture.GetSut();
sut.AddBreadcrumb(
Expand All @@ -419,7 +419,7 @@ public void AddBreadcrumb_Dictionary_AllArgumentsMatch()
const string expectedCategory = "original Category";
const string expectedType = "original Type";
var expectedData = new Dictionary<string, string> { { "key", "val" } };
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Critical;
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Fatal;

var sut = _fixture.GetSut();
sut.AddBreadcrumb(
Expand All @@ -446,7 +446,7 @@ public void AddBreadcrumb_ImmutableDictionary_AllArgumentsMatch()
const string expectedCategory = "original Category";
const string expectedType = "original Type";
var expectedData = new Dictionary<string, string> { { "key", "val" } };
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Critical;
const BreadcrumbLevel expectedLevel = BreadcrumbLevel.Fatal;

var sut = _fixture.GetSut();
sut.AddBreadcrumb(
Expand Down
Loading