Skip to content

Commit

Permalink
Bump Serilog to 3.1.1 (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r authored Feb 27, 2024
1 parent 5fb68fe commit cd08cf8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ApiApprovalTests
{
/// <summary>Check for changes to the public APIs.</summary>
/// <param name="type">The type used as a marker for the assembly whose public API change you want to check.</param>
[TestCase(typeof(LoggerConfigurationAppSettingsExtensions))]
[TestCase(typeof(LoggerConfigurationAttributedExtensions))]
public void PublicApi_Should_Not_Change_Unintentionally(Type type)
{
string publicApi = type.Assembly.GeneratePublicApi(new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace Destructurama.Attributed
}
namespace Destructurama
{
public static class LoggerConfigurationAppSettingsExtensions
public static class LoggerConfigurationAttributedExtensions
{
public static Serilog.LoggerConfiguration UsingAttributes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration) { }
public static Serilog.LoggerConfiguration UsingAttributes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration, System.Action<Destructurama.Attributed.AttributedDestructuringPolicyOptions> configure) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ public LogAsScalarAttribute(bool isMutable = false)
}

/// <inheritdoc/>
public LogEventPropertyValue CreateLogEventPropertyValue(object? value, ILogEventPropertyValueFactory propertyValueFactory) =>
new ScalarValue(_isMutable ? value?.ToString() : value);
public LogEventPropertyValue CreateLogEventPropertyValue(object? value, ILogEventPropertyValueFactory propertyValueFactory)
{
var v = _isMutable ? value?.ToString() : value;
return v == null ? ScalarValue.Null : new ScalarValue(v);
}

/// <inheritdoc/>
public bool TryCreateLogEventProperty(string name, object? value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventProperty property)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private LogEventPropertyValue CreateValue(object? value)
{
IEnumerable<string> strings => new SequenceValue(strings.Select(s => new ScalarValue(FormatMaskedValue(s)))),
string s => new ScalarValue(FormatMaskedValue(s)),
_ => new ScalarValue(null)
_ => ScalarValue.Null
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public bool TryCreateLogEventProperty(string name, object? value, ILogEventPrope
{
if (value == null)
{
property = new(name, new ScalarValue(value));
property = new(name, ScalarValue.Null);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="[2.10.0,4.0.0)" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<InternalsVisibleTo Include="Destructurama.Attributed.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />
<InternalsVisibleTo Include="Benchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100638a43140e8a1271c1453df1379e64b40b67a1f333864c1aef5ac318a0fa2008545c3d35a82ef005edf0de1ad1e1ea155722fe289df0e462f78c40a668cbc96d7be1d487faef5714a54bb4e57909c86b3924c2db6d55ccf59939b99eb0cab6e8a91429ba0ce630c08a319b323bddcbbd509f1afe4ae77a6cbb8b447f588febc3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Destructurama;
/// <summary>
/// Adds the Destructure.UsingAttributes() extension to <see cref="LoggerConfiguration"/>.
/// </summary>
public static class LoggerConfigurationAppSettingsExtensions
public static class LoggerConfigurationAttributedExtensions
{
/// <summary>
/// Adds a custom <see cref="IDestructuringPolicy"/> to enable manipulation of how objects
Expand Down

0 comments on commit cd08cf8

Please sign in to comment.