Skip to content

Bump Serilog to 3.1.1 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 22, 2024
Merged
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
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
Copy link
Member Author

Choose a reason for hiding this comment

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

@nblumhardt I think this class was initially copied from other project. I rename it in light of major version bump. OK?

{
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>
Copy link
Member Author

Choose a reason for hiding this comment

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

@nblumhardt Keep net462 or drop?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's value in 462, I'd also consider adding net6.0; no strong feelings though

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll publish net462;netstandard2.0 in v3. We can add net6 later if some issue arises.

<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