Skip to content

Commit cd08cf8

Browse files
authored
Bump Serilog to 3.1.1 (#99)
1 parent 5fb68fe commit cd08cf8

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed

src/Destructurama.Attributed.Tests/Approval/ApiApprovalTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ApiApprovalTests
2424
{
2525
/// <summary>Check for changes to the public APIs.</summary>
2626
/// <param name="type">The type used as a marker for the assembly whose public API change you want to check.</param>
27-
[TestCase(typeof(LoggerConfigurationAppSettingsExtensions))]
27+
[TestCase(typeof(LoggerConfigurationAttributedExtensions))]
2828
public void PublicApi_Should_Not_Change_Unintentionally(Type type)
2929
{
3030
string publicApi = type.Assembly.GeneratePublicApi(new()

src/Destructurama.Attributed.Tests/Approval/Destructurama.Attributed.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace Destructurama.Attributed
6767
}
6868
namespace Destructurama
6969
{
70-
public static class LoggerConfigurationAppSettingsExtensions
70+
public static class LoggerConfigurationAttributedExtensions
7171
{
7272
public static Serilog.LoggerConfiguration UsingAttributes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration) { }
7373
public static Serilog.LoggerConfiguration UsingAttributes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration, System.Action<Destructurama.Attributed.AttributedDestructuringPolicyOptions> configure) { }

src/Destructurama.Attributed/Attributed/LogAsScalarAttribute.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ public LogAsScalarAttribute(bool isMutable = false)
4040
}
4141

4242
/// <inheritdoc/>
43-
public LogEventPropertyValue CreateLogEventPropertyValue(object? value, ILogEventPropertyValueFactory propertyValueFactory) =>
44-
new ScalarValue(_isMutable ? value?.ToString() : value);
43+
public LogEventPropertyValue CreateLogEventPropertyValue(object? value, ILogEventPropertyValueFactory propertyValueFactory)
44+
{
45+
var v = _isMutable ? value?.ToString() : value;
46+
return v == null ? ScalarValue.Null : new ScalarValue(v);
47+
}
4548

4649
/// <inheritdoc/>
4750
public bool TryCreateLogEventProperty(string name, object? value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventProperty property)

src/Destructurama.Attributed/Attributed/LogMaskedAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private LogEventPropertyValue CreateValue(object? value)
119119
{
120120
IEnumerable<string> strings => new SequenceValue(strings.Select(s => new ScalarValue(FormatMaskedValue(s)))),
121121
string s => new ScalarValue(FormatMaskedValue(s)),
122-
_ => new ScalarValue(null)
122+
_ => ScalarValue.Null
123123
};
124124
}
125125
}

src/Destructurama.Attributed/Attributed/LogReplacedAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public bool TryCreateLogEventProperty(string name, object? value, ILogEventPrope
5454
{
5555
if (value == null)
5656
{
57-
property = new(name, new ScalarValue(value));
57+
property = new(name, ScalarValue.Null);
5858
return true;
5959
}
6060

src/Destructurama.Attributed/Destructurama.Attributed.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Serilog" Version="[2.10.0,4.0.0)" />
11+
<PackageReference Include="Serilog" Version="3.1.1" />
1212
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
1313
<InternalsVisibleTo Include="Destructurama.Attributed.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />
1414
<InternalsVisibleTo Include="Benchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />

src/Destructurama.Attributed/LoggerConfigurationAttributedExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Destructurama;
2222
/// <summary>
2323
/// Adds the Destructure.UsingAttributes() extension to <see cref="LoggerConfiguration"/>.
2424
/// </summary>
25-
public static class LoggerConfigurationAppSettingsExtensions
25+
public static class LoggerConfigurationAttributedExtensions
2626
{
2727
/// <summary>
2828
/// Adds a custom <see cref="IDestructuringPolicy"/> to enable manipulation of how objects

0 commit comments

Comments
 (0)