Skip to content

Commit 89af075

Browse files
authored
Merge branch 'dev' into feature/nullableReference
2 parents d3d36f6 + ddb04ae commit 89af075

File tree

8 files changed

+27
-50
lines changed

8 files changed

+27
-50
lines changed

Build.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
Write-Host "build: Build started"
1+
Write-Output "build: Build started"
2+
3+
& dotnet --info
4+
& dotnet --list-sdks
25

36
Push-Location $PSScriptRoot
47

58
if(Test-Path .\artifacts) {
6-
Write-Host "build: Cleaning .\artifacts"
9+
Write-Output "build: Cleaning .\artifacts"
710
Remove-Item .\artifacts -Force -Recurse
811
}
912

@@ -15,13 +18,13 @@ $suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch
1518
$commitHash = $(git rev-parse --short HEAD)
1619
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1720

18-
Write-Host "build: Package version suffix is $suffix"
19-
Write-Host "build: Build version suffix is $buildSuffix"
21+
Write-Output "build: Package version suffix is $suffix"
22+
Write-Output "build: Build version suffix is $buildSuffix"
2023

2124
foreach ($src in Get-ChildItem src/*) {
2225
Push-Location $src
2326

24-
Write-Host "build: Packaging project in $src"
27+
Write-Output "build: Packaging project in $src"
2528

2629
& dotnet build -c Release --version-suffix=$buildSuffix
2730
if ($suffix) {
@@ -37,7 +40,7 @@ foreach ($src in Get-ChildItem src/*) {
3740
foreach ($sample in Get-ChildItem sample/*) {
3841
Push-Location $sample
3942

40-
Write-Host "build: Testing project in $sample"
43+
Write-Output "build: Testing project in $sample"
4144

4245
& dotnet build -c Release --version-suffix=$buildSuffix
4346
if($LASTEXITCODE -ne 0) { exit 3 }
@@ -48,7 +51,7 @@ foreach ($sample in Get-ChildItem sample/*) {
4851
foreach ($test in Get-ChildItem test/*.Tests) {
4952
Push-Location $test
5053

51-
Write-Host "build: Testing project in $test"
54+
Write-Output "build: Testing project in $test"
5255

5356
& dotnet test -c Release
5457
if($LASTEXITCODE -ne 0) { exit 3 }

sample/ConsoleDemo/ConsoleDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net45;netcoreapp2.2</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

src/Serilog.Sinks.Console/ConsoleLoggerConfigurationExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public static class ConsoleLoggerConfigurationExtensions
5050
/// uses <see cref="SystemConsoleTheme.Literate"/>.</param>
5151
/// <param name="applyThemeToRedirectedOutput">Applies the selected or default theme even when output redirection is detected.</param>
5252
/// <returns>Configuration object allowing method chaining.</returns>
53+
/// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
54+
/// <exception cref="ArgumentNullException">When <paramref name="outputTemplate"/> is <code>null</code></exception>
5355
public static LoggerConfiguration Console(
5456
this LoggerSinkConfiguration sinkConfiguration,
5557
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
@@ -89,6 +91,8 @@ public static LoggerConfiguration Console(
8991
/// to be changed at runtime.</param>
9092
/// <param name="standardErrorFromLevel">Specifies the level at which events will be written to standard error.</param>
9193
/// <returns>Configuration object allowing method chaining.</returns>
94+
/// <exception cref="ArgumentNullException">When <paramref name="sinkConfiguration"/> is <code>null</code></exception>
95+
/// <exception cref="ArgumentNullException">When <paramref name="formatter"/> is <code>null</code></exception>
9296
public static LoggerConfiguration Console(
9397
this LoggerSinkConfiguration sinkConfiguration,
9498
ITextFormatter formatter,
Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>A Serilog sink that writes log events to the console/terminal.</Description>
55
<VersionPrefix>4.0.0</VersionPrefix>
66
<Authors>Serilog Contributors</Authors>
7-
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp1.1;netcoreapp2.0;netcoreapp3.0;netcoreapp3.1;</TargetFrameworks>
7+
<TargetFrameworks>net45;netstandard1.3;netstandard2.0;</TargetFrameworks>
88
<LangVersion>8.0</LangVersion>
99
<Nullable>enable</Nullable>
1010
<AssemblyName>Serilog.Sinks.Console</AssemblyName>
@@ -22,39 +22,18 @@
2222
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
2323
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2424
<!-- Don't reference the full NETStandard.Library -->
25-
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' And '$(TargetFramework)' != 'netstandard2.1' And '$(TargetFramework)' != 'netcoreapp2.0' And '$(TargetFramework)' != 'netcoreapp3.0' And '$(TargetFramework)' != 'netcoreapp3.1' ">true</DisableImplicitFrameworkReferences>
25+
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' ">true</DisableImplicitFrameworkReferences>
2626
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
2727
<TreatSpecificWarningsAsErrors />
2828
<RootNamespace>Serilog</RootNamespace>
2929
</PropertyGroup>
3030

31-
32-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
33-
<DefineConstants>$(DefineConstants);PINVOKE</DefineConstants>
34-
</PropertyGroup>
35-
36-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' or '$(TargetFramework)' == 'netcoreapp2.0' or '$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netcoreapp3.1' ">
37-
<DefineConstants>$(DefineConstants);PINVOKE;RUNTIME_INFORMATION</DefineConstants>
31+
<PropertyGroup Condition=" '$(TargetFramework)' != 'net45' ">
32+
<DefineConstants>$(DefineConstants);RUNTIME_INFORMATION</DefineConstants>
3833
</PropertyGroup>
3934

4035
<ItemGroup>
4136
<PackageReference Include="Serilog" Version="2.8.0" />
4237
</ItemGroup>
4338

44-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
45-
<Reference Include="System" />
46-
<Reference Include="System.Core" />
47-
<Reference Include="Microsoft.CSharp" />
48-
</ItemGroup>
49-
50-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' ">
51-
<PackageReference Include="System.Console" Version="4.3.0" />
52-
</ItemGroup>
53-
54-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' or '$(TargetFramework)' == 'netcoreapp2.0' or '$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netcoreapp3.1' ">
55-
<PackageReference Include="System.Console" Version="4.3.0" />
56-
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
57-
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
58-
</ItemGroup>
59-
60-
</Project>
39+
</Project>

src/Serilog.Sinks.Console/Sinks/SystemConsole/Platform/WindowsConsole.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#if PINVOKE
1615
using System;
1716
using System.Runtime.InteropServices;
18-
#endif
1917

2018
namespace Serilog.Sinks.SystemConsole.Platform
2119
{
2220
static class WindowsConsole
2321
{
24-
#if PINVOKE
2522
public static void EnableVirtualTerminalProcessing()
2623
{
2724
#if RUNTIME_INFORMATION
@@ -50,10 +47,6 @@ public static void EnableVirtualTerminalProcessing()
5047

5148
[DllImport("kernel32.dll", SetLastError = true)]
5249
static extern bool SetConsoleMode(IntPtr handle, uint mode);
53-
#else
54-
public static void EnableVirtualTerminalProcessing()
55-
{
56-
}
57-
#endif
50+
5851
}
5952
}

src/Serilog.Sinks.Console/Sinks/SystemConsole/Themes/AnsiConsoleTheme.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class AnsiConsoleTheme : ConsoleTheme
4747
/// Construct a theme given a set of styles.
4848
/// </summary>
4949
/// <param name="styles">Styles to apply within the theme.</param>
50+
/// <exception cref="ArgumentNullException">When <paramref name="styles"/> is <code>null</code></exception>
5051
public AnsiConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, string> styles)
5152
{
5253
if (styles is null) throw new ArgumentNullException(nameof(styles));

src/Serilog.Sinks.Console/Sinks/SystemConsole/Themes/SystemConsoleTheme.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class SystemConsoleTheme : ConsoleTheme
4444
/// Construct a theme given a set of styles.
4545
/// </summary>
4646
/// <param name="styles">Styles to apply within the theme.</param>
47+
/// <exception cref="ArgumentNullException">When <paramref name="styles"/> is <code>null</code></exception>
4748
public SystemConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> styles)
4849
{
4950
if (styles is null) throw new ArgumentNullException(nameof(styles));

test/Serilog.Sinks.Console.Tests/Serilog.Sinks.Console.Tests.csproj

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net452;net462;net472;net48;netcoreapp2.2;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
55
<AssemblyName>Serilog.Sinks.SystemConsole.Tests</AssemblyName>
66
<PackageId>Serilog.Sinks.Console.Tests</PackageId>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
@@ -27,16 +27,12 @@
2727

2828
<ItemGroup>
2929
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
30-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
30+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
3131
<PrivateAssets>all</PrivateAssets>
3232
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3333
</PackageReference>
3434
<PackageReference Include="xunit" Version="2.4.1" />
3535
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
3636
</ItemGroup>
3737

38-
<ItemGroup>
39-
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
40-
</ItemGroup>
41-
4238
</Project>

0 commit comments

Comments
 (0)