Skip to content

Commit

Permalink
Bump Serilog to 3.1.1 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r authored Jan 22, 2024
1 parent b3950ef commit 6a32668
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[![Publish release to Nuget registry](https://github.com/destructurama/json-net/actions/workflows/publish-release.yml/badge.svg)](https://github.com/destructurama/json-net/actions/workflows/publish-release.yml)
[![CodeQL analysis](https://github.com/destructurama/json-net/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/destructurama/json-net/actions/workflows/codeql-analysis.yml)

Adds support for logging JSON.NET dynamic types as structured data with Serilog.
Adds support for logging JSON.NET dynamic types as structured data with [Serilog](https://serilog.net).

# Installation

Expand Down
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>
[Theory]
[InlineData(typeof(LoggerConfigurationAppSettingsExtensions))]
[InlineData(typeof(LoggerConfigurationJsonNetExtensions))]
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
@@ -1,6 +1,6 @@
namespace Destructurama
{
public static class LoggerConfigurationAppSettingsExtensions
public static class LoggerConfigurationJsonNetExtensions
{
public static Serilog.LoggerConfiguration JsonNetTypes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration) { }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
Expand Down
14 changes: 14 additions & 0 deletions src/Destructurama.JsonNet.Tests/JsonNetTypesDestructuringTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Destructurama.JsonNet.Tests.Support;
using Newtonsoft.Json;
using Serilog;
Expand Down
14 changes: 14 additions & 0 deletions src/Destructurama.JsonNet.Tests/Support/DelegatingSink.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Serilog.Core;
using Serilog.Events;

Expand Down
20 changes: 16 additions & 4 deletions src/Destructurama.JsonNet.Tests/Support/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
// Copyright 2017 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using Serilog.Events;

namespace Destructurama.JsonNet.Tests.Support;

public static class Extensions
internal static class Extensions
{
public static object? LiteralValue(this LogEventPropertyValue @this)
{
return ((ScalarValue)@this).Value;
}
=> ((ScalarValue)@this).Value;
}
4 changes: 2 additions & 2 deletions src/Destructurama.JsonNet/Destructurama.JsonNet.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Description>Adds support for logging JSON.NET dynamic types as structured data with Serilog.</Description>
<RootNamespace>Destructurama</RootNamespace>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<InternalsVisibleTo Include="Benchmarks, PublicKey=00240000048000009400000006020000002400005253413100040000010001000fe215af9b769897395aac526ca6744222fcf543787b16f58980844d6c49f65bbf0a62502d69646c58f14a8a29ba60d43c85a2a5ef1ed103c9a0e18d6491e4b0bafd2c25e290028d19203d4366ae5651aafd48abaf485588fd6a25fbe23c2c9a644a24337a041966b09cbb73dc3a080bf79564d15a26e97c1bff4f345ee256a9" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Ignore Spelling: App

using Destructurama.JsonNet;
using Serilog;
using Serilog.Configuration;
Expand All @@ -23,7 +21,7 @@ namespace Destructurama;
/// <summary>
/// Adds the Destructure.JsonNetTypes() extension to <see cref="LoggerConfiguration"/>.
/// </summary>
public static class LoggerConfigurationAppSettingsExtensions
public static class LoggerConfigurationJsonNetExtensions
{
/// <summary>
/// Enable destructuring of JSON.NET dynamic objects.
Expand Down

1 comment on commit 6a32668

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.01.

Benchmark suite Current: 6a32668 Previous: b3950ef Ratio
Benchmarks.JsonNetBenchmarks.Destructure 2325.8810572306315 ns (± 9.896052692196491) 2035.4098457923303 ns (± 7.513269390553504) 1.14

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.