From 5dd050c05cd4157bb5d4e1cb4eeb4eae382ecd2d Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 13:54:06 +0100 Subject: [PATCH 1/7] Update TFMs --- global.json | 5 ----- sample/DebugDemo/DebugDemo.csproj | 2 +- .../Serilog.Sinks.Debug.csproj | 17 ++++++----------- .../Sinks/Debug/DebugSink.cs | 4 ---- .../Serilog.Sinks.Debug.Tests.csproj | 2 +- 5 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 global.json diff --git a/global.json b/global.json deleted file mode 100644 index 2cb2ac9..0000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "5.0.100" - } -} \ No newline at end of file diff --git a/sample/DebugDemo/DebugDemo.csproj b/sample/DebugDemo/DebugDemo.csproj index b46bffa..24278ce 100644 --- a/sample/DebugDemo/DebugDemo.csproj +++ b/sample/DebugDemo/DebugDemo.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net8.0 diff --git a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj index 4c13b5a..1964213 100644 --- a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj +++ b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj @@ -4,7 +4,12 @@ A Serilog sink that writes log events to the debug output window. 2.0.1 Serilog Contributors - net45;net46;netstandard1.0;netstandard2.0;netstandard2.1 + + net471;net462 + + $(TargetFrameworks);net8.0;net6.0;netstandard2.0 Serilog.Sinks.Debug ../../assets/Serilog.snk true @@ -17,8 +22,6 @@ https://github.com/serilog/serilog-sinks-debug git true - - true True Serilog @@ -32,14 +35,6 @@ - - - - - - $(DefineConstants);DEBUG_WRITE - - diff --git a/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs b/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs index 3946eca..1e1f802 100644 --- a/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs +++ b/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs @@ -34,11 +34,7 @@ public void Emit(LogEvent logEvent) using (var buffer = new StringWriter()) { _formatter.Format(logEvent, buffer); -#if DEBUG_WRITE System.Diagnostics.Debug.Write(buffer.ToString()); -#else - System.Diagnostics.Debug.WriteLine(buffer.ToString().Trim()); -#endif } } } diff --git a/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj b/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj index caa2ba5..80de946 100644 --- a/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj +++ b/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net8.0;net48 ../../assets/Serilog.snk true true From e87925cf3ac0a8909db07d0ef2b818e4d4c1c214 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:02:56 +0100 Subject: [PATCH 2/7] Update dependencies --- src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj | 2 +- .../Serilog.Sinks.Debug.Tests.csproj | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj index 1964213..bec1407 100644 --- a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj +++ b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj @@ -32,7 +32,7 @@ - + diff --git a/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj b/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj index 80de946..6e8c908 100644 --- a/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj +++ b/test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj @@ -5,6 +5,7 @@ ../../assets/Serilog.snk true true + false @@ -12,10 +13,12 @@ - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From da0abab3c89d6eb7d487a2a71fb8daacc23f13c6 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:04:53 +0100 Subject: [PATCH 3/7] Seal the sink class --- src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs b/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs index 1e1f802..6c3e5cd 100644 --- a/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs +++ b/src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs @@ -20,7 +20,7 @@ namespace Serilog.Sinks.Debug { - class DebugSink : ILogEventSink + sealed class DebugSink : ILogEventSink { readonly ITextFormatter _formatter; From 590a963ea4b50681e8a05f8314e20b7ad2d04860 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:07:08 +0100 Subject: [PATCH 4/7] Include the readme file in the nuget package --- src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj index bec1407..d07c989 100644 --- a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj +++ b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj @@ -19,8 +19,7 @@ https://github.com/serilog/serilog-sinks-debug Apache-2.0 icon.png - https://github.com/serilog/serilog-sinks-debug - git + README.md true True Serilog @@ -37,6 +36,7 @@ + From 60ba0f27ba590481795694da39da43da63cca434 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:09:39 +0100 Subject: [PATCH 5/7] Enable SourceLink, with a snupkg file . --- appveyor.yml | 5 ++++- src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6381f73..4a8f460 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,7 @@ build_script: - ps: ./Build.ps1 artifacts: - path: artifacts/Serilog.*.nupkg +- path: artifacts/Serilog.*.snupkg deploy: - provider: NuGet api_key: @@ -17,7 +18,9 @@ deploy: - provider: GitHub auth_token: secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX - artifact: /Serilog.*\.nupkg/ + artifacts: + /Serilog.*\.nupkg/ + /Serilog.*\.snupkg/ tag: v$(appveyor_build_version) on: branch: master diff --git a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj index d07c989..97fe17f 100644 --- a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj +++ b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj @@ -20,6 +20,10 @@ Apache-2.0 icon.png README.md + true + true + true + snupkg true True Serilog From 615152c454befae4712bde20da45abae6bb16563 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:11:25 +0100 Subject: [PATCH 6/7] Set version to 3 --- src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj index 97fe17f..ce087af 100644 --- a/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj +++ b/src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj @@ -2,7 +2,7 @@ A Serilog sink that writes log events to the debug output window. - 2.0.1 + 3.0.0 Serilog Contributors net471;net462 From 19e25de6af427be9eec08e37fa1d6ade3da9064a Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 14:13:32 +0100 Subject: [PATCH 7/7] Set ContinuousIntegrationBuild=true in the CI build --- Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.ps1 b/Build.ps1 index ee4117d..4c96282 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -23,7 +23,7 @@ foreach ($src in ls src/*) { echo "build: Packaging project in $src" - & dotnet build -c Release --version-suffix=$buildSuffix + & dotnet build -c Release --version-suffix=$buildSuffix -p:ContinuousIntegrationBuild=true if ($suffix) { & dotnet pack -c Release --include-source -o ..\..\artifacts --version-suffix=$suffix --no-build } else {