From b6aaa4ee6b92701152fded3fede9dd2df2a4027f Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sat, 20 Jan 2024 20:58:17 +0300 Subject: [PATCH 1/4] Bump Serilog to 3.1.1 --- src/Destructurama.JsonNet.Tests/Approval/ApiApprovalTests.cs | 2 +- .../Approval/Destructurama.JsonNet.approved.txt | 2 +- .../Destructurama.JsonNet.Tests.csproj | 2 +- src/Destructurama.JsonNet/Destructurama.JsonNet.csproj | 4 ++-- .../LoggerConfigurationJsonNetExtensions.cs | 4 +--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Destructurama.JsonNet.Tests/Approval/ApiApprovalTests.cs b/src/Destructurama.JsonNet.Tests/Approval/ApiApprovalTests.cs index 2edf04e..41f38ea 100644 --- a/src/Destructurama.JsonNet.Tests/Approval/ApiApprovalTests.cs +++ b/src/Destructurama.JsonNet.Tests/Approval/ApiApprovalTests.cs @@ -24,7 +24,7 @@ public class ApiApprovalTests /// Check for changes to the public APIs. /// The type used as a marker for the assembly whose public API change you want to check. [Theory] - [InlineData(typeof(LoggerConfigurationAppSettingsExtensions))] + [InlineData(typeof(LoggerConfigurationJsonNetExtensions))] public void PublicApi_Should_Not_Change_Unintentionally(Type type) { string publicApi = type.Assembly.GeneratePublicApi(new() diff --git a/src/Destructurama.JsonNet.Tests/Approval/Destructurama.JsonNet.approved.txt b/src/Destructurama.JsonNet.Tests/Approval/Destructurama.JsonNet.approved.txt index 0514f10..889d77e 100644 --- a/src/Destructurama.JsonNet.Tests/Approval/Destructurama.JsonNet.approved.txt +++ b/src/Destructurama.JsonNet.Tests/Approval/Destructurama.JsonNet.approved.txt @@ -1,6 +1,6 @@ namespace Destructurama { - public static class LoggerConfigurationAppSettingsExtensions + public static class LoggerConfigurationJsonNetExtensions { public static Serilog.LoggerConfiguration JsonNetTypes(this Serilog.Configuration.LoggerDestructuringConfiguration configuration) { } } diff --git a/src/Destructurama.JsonNet.Tests/Destructurama.JsonNet.Tests.csproj b/src/Destructurama.JsonNet.Tests/Destructurama.JsonNet.Tests.csproj index 2904639..653b46d 100644 --- a/src/Destructurama.JsonNet.Tests/Destructurama.JsonNet.Tests.csproj +++ b/src/Destructurama.JsonNet.Tests/Destructurama.JsonNet.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Destructurama.JsonNet/Destructurama.JsonNet.csproj b/src/Destructurama.JsonNet/Destructurama.JsonNet.csproj index 989cdbc..40fa908 100644 --- a/src/Destructurama.JsonNet/Destructurama.JsonNet.csproj +++ b/src/Destructurama.JsonNet/Destructurama.JsonNet.csproj @@ -1,7 +1,7 @@ - net452;netstandard2.0 + net462;netstandard2.0 Adds support for logging JSON.NET dynamic types as structured data with Serilog. Destructurama true @@ -9,7 +9,7 @@ - + diff --git a/src/Destructurama.JsonNet/LoggerConfigurationJsonNetExtensions.cs b/src/Destructurama.JsonNet/LoggerConfigurationJsonNetExtensions.cs index 18fd570..7a4cf1d 100644 --- a/src/Destructurama.JsonNet/LoggerConfigurationJsonNetExtensions.cs +++ b/src/Destructurama.JsonNet/LoggerConfigurationJsonNetExtensions.cs @@ -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; @@ -23,7 +21,7 @@ namespace Destructurama; /// /// Adds the Destructure.JsonNetTypes() extension to . /// -public static class LoggerConfigurationAppSettingsExtensions +public static class LoggerConfigurationJsonNetExtensions { /// /// Enable destructuring of JSON.NET dynamic objects. From bbe000725629f1718f34820bd7f459d902f25635 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sun, 21 Jan 2024 09:53:15 +0300 Subject: [PATCH 2/4] add missed notice --- .../JsonNetTypesDestructuringTests.cs | 14 ++++++++++++++ .../Support/DelegatingSink.cs | 14 ++++++++++++++ .../Support/Extensions.cs | 14 ++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/src/Destructurama.JsonNet.Tests/JsonNetTypesDestructuringTests.cs b/src/Destructurama.JsonNet.Tests/JsonNetTypesDestructuringTests.cs index 68f9d62..346e7c6 100644 --- a/src/Destructurama.JsonNet.Tests/JsonNetTypesDestructuringTests.cs +++ b/src/Destructurama.JsonNet.Tests/JsonNetTypesDestructuringTests.cs @@ -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; diff --git a/src/Destructurama.JsonNet.Tests/Support/DelegatingSink.cs b/src/Destructurama.JsonNet.Tests/Support/DelegatingSink.cs index 130651f..956bc33 100644 --- a/src/Destructurama.JsonNet.Tests/Support/DelegatingSink.cs +++ b/src/Destructurama.JsonNet.Tests/Support/DelegatingSink.cs @@ -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; diff --git a/src/Destructurama.JsonNet.Tests/Support/Extensions.cs b/src/Destructurama.JsonNet.Tests/Support/Extensions.cs index d0b910d..c5ded28 100644 --- a/src/Destructurama.JsonNet.Tests/Support/Extensions.cs +++ b/src/Destructurama.JsonNet.Tests/Support/Extensions.cs @@ -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.Events; namespace Destructurama.JsonNet.Tests.Support; From 21701eddfaf82b1220a4ead42fa0801be5749667 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Sun, 21 Jan 2024 10:58:39 +0300 Subject: [PATCH 3/4] 1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 931e4b4..bca1c81 100644 --- a/README.md +++ b/README.md @@ -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 From 901a5bc028e7c58cc2b1675dd787727df9966337 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Mon, 22 Jan 2024 08:36:24 +0300 Subject: [PATCH 4/4] 1 --- src/Destructurama.JsonNet.Tests/Support/Extensions.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Destructurama.JsonNet.Tests/Support/Extensions.cs b/src/Destructurama.JsonNet.Tests/Support/Extensions.cs index c5ded28..0761859 100644 --- a/src/Destructurama.JsonNet.Tests/Support/Extensions.cs +++ b/src/Destructurama.JsonNet.Tests/Support/Extensions.cs @@ -16,10 +16,8 @@ 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; }