From b2ef3720f2d743c270eda615700fda8f28d80fdf Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Sun, 14 Feb 2021 17:47:43 +1000 Subject: [PATCH 01/12] Dev version bump [skip ci] --- 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 a705177..4c13b5a 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.0 + 2.0.1 Serilog Contributors net45;net46;netstandard1.0;netstandard2.0;netstandard2.1 Serilog.Sinks.Debug From 481ed5ca0604301a751ee6a69cccc85855a3f014 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 4 Feb 2023 06:47:51 +1100 Subject: [PATCH 02/12] build on VS 2022 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5b6e397..6381f73 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: '{build}' skip_tags: true -image: Visual Studio 2019 +image: Visual Studio 2022 configuration: Release test: off build_script: From 5dd050c05cd4157bb5d4e1cb4eeb4eae382ecd2d Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Thu, 13 Jun 2024 13:54:06 +0100 Subject: [PATCH 03/12] 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 04/12] 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 05/12] 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 06/12] 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 07/12] 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 08/12] 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 09/12] 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 { From b114384527fc1a04475f748a9b69a0a0735deb56 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 14 Jun 2024 18:02:21 +1000 Subject: [PATCH 10/12] Publish from main; new key --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4a8f460..09f9730 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,10 +11,10 @@ artifacts: deploy: - provider: NuGet api_key: - secure: K3/810hkTO6rd2AEHVkUQAadjGmDREus9k96QHu6hxrA1/wRTuAJemHMKtVVgIvf + secure: sDnchSg4TZIOK7oIUI6BJwFPNENTOZrGNsroGO1hehLJSvlHpFmpTwiX8+bgPD+Q skip_symbols: true on: - branch: /^(master|dev)$/ + branch: /^(main|dev)$/ - provider: GitHub auth_token: secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX @@ -23,4 +23,4 @@ deploy: /Serilog.*\.snupkg/ tag: v$(appveyor_build_version) on: - branch: master + branch: main From 3aad4a8e4c3f3f0b31d614281ac4edaf8508276d Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 14 Jun 2024 18:02:50 +1000 Subject: [PATCH 11/12] Publish from main --- Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.ps1 b/Build.ps1 index 4c96282..3dee0bd 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -11,7 +11,7 @@ if(Test-Path .\artifacts) { $branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL]; $revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; -$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"] +$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"] $commitHash = $(git rev-parse --short HEAD) $buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] From d21bcbccf203ecb98aa5cc9ccdd536cbfb4ee4d3 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 14 Jun 2024 18:06:05 +1000 Subject: [PATCH 12/12] Remove obsolete Gitter link [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 038a8c9..411d5e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Serilog.Sinks.Debug [![Build status](https://ci.appveyor.com/api/projects/status/oufg4e51868oq4eu?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-debug) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Debug.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Debug/) [![Documentation](https://img.shields.io/badge/docs-wiki-yellow.svg)](https://github.com/serilog/serilog/wiki) [![Join the chat at https://gitter.im/serilog/serilog](https://img.shields.io/gitter/room/serilog/serilog.svg)](https://gitter.im/serilog/serilog) [![Help](https://img.shields.io/badge/stackoverflow-serilog-orange.svg)](http://stackoverflow.com/questions/tagged/serilog) +# Serilog.Sinks.Debug [![Build status](https://ci.appveyor.com/api/projects/status/oufg4e51868oq4eu?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-debug) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Debug.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Debug/) [![Help](https://img.shields.io/badge/stackoverflow-serilog-orange.svg)](http://stackoverflow.com/questions/tagged/serilog) A Serilog sink that writes log events to the Visual Studio debug output window. @@ -7,7 +7,7 @@ A Serilog sink that writes log events to the Visual Studio debug output window. To use the sink, first install the [NuGet package](https://nuget.org/packages/serilog.sinks.debug): ```powershell -Install-Package Serilog.Sinks.Debug +dotnet add package Serilog.Sinks.Debug ``` Then enable the sink using `WriteTo.Debug()`: