Skip to content

Commit 39fb48e

Browse files
committed
Added missing severity levels
1 parent 3a42ab2 commit 39fb48e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/EventLogExpert.Eventing.Tests/EventResolvers/EventResolverBaseTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,10 +1612,11 @@ public void ResolveEvent_WithSeverityLevel_ShouldResolveLevelString()
16121612
var testCases = new[]
16131613
{
16141614
(Level: (byte)0, Expected: "Information"),
1615+
(Level: (byte)1, Expected: "Critical"),
16151616
(Level: (byte)2, Expected: "Error"),
16161617
(Level: (byte)3, Expected: "Warning"),
16171618
(Level: (byte)4, Expected: "Information"),
1618-
(Level: (byte)5, Expected: "5")
1619+
(Level: (byte)5, Expected: "Verbose")
16191620
};
16201621

16211622
foreach (var testCase in testCases)

src/EventLogExpert.Eventing/Helpers/SeverityMethods.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ public enum SeverityLevel
77
{
88
Information,
99
Warning,
10-
Error
10+
Error,
11+
Critical,
12+
Verbose
1113
}
1214

1315
public static class Severity
1416
{
1517
public static string GetString(byte? level) => level switch
1618
{
1719
0 => nameof(SeverityLevel.Information),
20+
1 => nameof(SeverityLevel.Critical),
1821
2 => nameof(SeverityLevel.Error),
1922
3 => nameof(SeverityLevel.Warning),
2023
4 => nameof(SeverityLevel.Information),
24+
5 => nameof(SeverityLevel.Verbose),
2125
_ => level?.ToString() ?? string.Empty
2226
};
2327
}

0 commit comments

Comments
 (0)