Skip to content

Commit 9f26947

Browse files
committed
Tidy up, fix build, add net5.0 targets, use the Nullable support package
1 parent ffc2c0f commit 9f26947

File tree

18 files changed

+60
-206
lines changed

18 files changed

+60
-206
lines changed

.idea/.idea.serilog-sinks-console/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.serilog-sinks-console/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.serilog-sinks-console/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.serilog-sinks-console/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if(Test-Path .\artifacts) {
1414

1515
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1616
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
17-
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
17+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
1818
$commitHash = $(git rev-parse --short HEAD)
1919
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
2020

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ A Serilog sink that writes log events to the Windows Console or an ANSI terminal
66

77
To use the console sink, first install the [NuGet package](https://nuget.org/packages/serilog.sinks.console):
88

9-
```powershell
10-
Install-Package Serilog.Sinks.Console
9+
```shell
10+
dotnet add package Serilog.Sinks.Console
1111
```
1212

1313
Then enable the sink using `WriteTo.Console()`:
@@ -64,8 +64,8 @@ The default template, shown in the example above, uses built-in properties like
6464

6565
The sink can write JSON output instead of plain text. `CompactJsonFormatter` or `RenderedCompactJsonFormatter` from [Serilog.Formatting.Compact](https://github.com/serilog/serilog-formatting-compact) is recommended:
6666

67-
```powershell
68-
Install-Package Serilog.Formatting.Compact
67+
```shell
68+
dotnet add package Serilog.Formatting.Compact
6969
```
7070

7171
Pass a formatter to the `Console()` configuration method:
@@ -80,8 +80,8 @@ Output theming is not available when custom formatters are used.
8080

8181
To use the console sink with the [Serilog.Settings.AppSettings](https://github.com/serilog/serilog-settings-appsettings) package, first install that package if you haven't already done so:
8282

83-
```powershell
84-
Install-Package Serilog.Settings.AppSettings
83+
```shell
84+
dotnet add package Serilog.Settings.AppSettings
8585
```
8686

8787
Instead of configuring the logger in code, call `ReadFrom.AppSettings()`:
@@ -114,8 +114,8 @@ To configure the console sink with a different theme and include the `SourceCont
114114

115115
To use the console sink with _Microsoft.Extensions.Configuration_, for example with ASP.NET Core or .NET Core, use the [Serilog.Settings.Configuration](https://github.com/serilog/serilog-settings-configuration) package. First install that package if you have not already done so:
116116

117-
```powershell
118-
Install-Package Serilog.Settings.Configuration
117+
```shell
118+
dotnet add package Serilog.Settings.Configuration
119119
```
120120

121121
Instead of configuring the sink directly in code, call `ReadFrom.Configuration()`:
@@ -168,7 +168,7 @@ When contributing please keep in mind our [Code of Conduct](CODE_OF_CONDUCT.md).
168168
Branch | AppVeyor | Travis
169169
------------- | ------------- |-------------
170170
dev | [![Build status](https://ci.appveyor.com/api/projects/status/w1w3m1wyk3in1c96/branch/dev?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-console/branch/dev) | [![Build Status](https://travis-ci.org/serilog/serilog-sinks-console.svg?branch=dev)](https://travis-ci.org/serilog/serilog-sinks-console)
171-
master | [![Build status](https://ci.appveyor.com/api/projects/status/w1w3m1wyk3in1c96/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-console/branch/master) | [![Build Status](https://travis-ci.org/serilog/serilog-sinks-console.svg?branch=master)](https://travis-ci.org/serilog/serilog-sinks-console)
171+
main | [![Build status](https://ci.appveyor.com/api/projects/status/w1w3m1wyk3in1c96/branch/main?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-console/branch/main) | [![Build Status](https://travis-ci.org/serilog/serilog-sinks-console.svg?branch=main)](https://travis-ci.org/serilog/serilog-sinks-console)
172172

173173

174-
_Copyright © 2017 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html)._
174+
_Copyright © Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html)._

appveyor.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: '{build}'
22
skip_tags: true
33
image: Visual Studio 2019
4-
configuration: Release
54
test: off
65
build_script:
76
- ps: ./Build.ps1
@@ -10,14 +9,14 @@ artifacts:
109
deploy:
1110
- provider: NuGet
1211
api_key:
13-
secure: N59tiJECUYpip6tEn0xvdmDAEiP9SIzyLEFLpwiigm/8WhJvBNs13QxzT1/3/JW/
12+
secure: rbdBqxBpLt4MkB+mrDOYNDOd8aVZ1zMkysaVNAXNKnC41FYifzX3l9LM8DCrUWU5
1413
skip_symbols: true
1514
on:
16-
branch: /^(master|dev)$/
15+
branch: /^(main|dev)$/
1716
- provider: GitHub
1817
auth_token:
1918
secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX
2019
artifact: /Serilog.*\.nupkg/
2120
tag: v$(appveyor_build_version)
2221
on:
23-
branch: master
22+
branch: main

assets/icon.png

19.9 KB
Loading

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>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net452;net462;net472;net48;net5.0</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

sample/ConsoleDemo/Program.cs

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

66
namespace ConsoleDemo
77
{
8-
public class Program
8+
public static class Program
99
{
1010
public static void Main()
1111
{

0 commit comments

Comments
 (0)