Skip to content

Commit

Permalink
Merge pull request #14 from Numpsy/updates
Browse files Browse the repository at this point in the history
Updates for Serilog 4
  • Loading branch information
nblumhardt authored Jun 14, 2024
2 parents 481ed5c + 19e25de commit aaba502
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build_script:
- ps: ./Build.ps1
artifacts:
- path: artifacts/Serilog.*.nupkg
- path: artifacts/Serilog.*.snupkg
deploy:
- provider: NuGet
api_key:
Expand All @@ -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
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

2 changes: 1 addition & 1 deletion sample/DebugDemo/DebugDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
29 changes: 14 additions & 15 deletions src/Serilog.Sinks.Debug/Serilog.Sinks.Debug.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

<PropertyGroup>
<Description>A Serilog sink that writes log events to the debug output window.</Description>
<VersionPrefix>2.0.1</VersionPrefix>
<VersionPrefix>3.0.0</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>net45;net46;netstandard1.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<!-- .NET Framework version targeting is frozen at these two TFMs. -->
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">net471;net462</TargetFrameworks>
<!-- Policy is to trim TFM-specific builds to `netstandard2.0`, `net6.0`,
all active LTS versions, and optionally the latest RTM version, when releasing new
major Serilog versions. -->
<TargetFrameworks>$(TargetFrameworks);net8.0;net6.0;netstandard2.0</TargetFrameworks>
<AssemblyName>Serilog.Sinks.Debug</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -14,11 +19,12 @@
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-debug</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>https://github.com/serilog/serilog-sinks-debug</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Don't reference the full NETStandard.Library -->
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' == 'netstandard1.0' ">true</DisableImplicitFrameworkReferences>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<RootNamespace>Serilog</RootNamespace>
</PropertyGroup>
Expand All @@ -29,19 +35,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog" Version="4.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.0' ">
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'netstandard1.0' ">
<DefineConstants>$(DefineConstants);DEBUG_WRITE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\assets\icon.png" Pack="true" Visible="false" PackagePath="" />
<None Include="../../README.md" Pack="true" Visible="false" PackagePath="/" />
</ItemGroup>

</Project>
6 changes: 1 addition & 5 deletions src/Serilog.Sinks.Debug/Sinks/Debug/DebugSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace Serilog.Sinks.Debug
{
class DebugSink : ILogEventSink
sealed class DebugSink : ILogEventSink
{
readonly ITextFormatter _formatter;

Expand All @@ -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
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions test/Serilog.Sinks.Debug.Tests/Serilog.Sinks.Debug.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Debug\Serilog.Sinks.Debug.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit aaba502

Please sign in to comment.