-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from serilog/dev
7.0.0 Release
- Loading branch information
Showing
79 changed files
with
5,015 additions
and
3,620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ end_of_line = lf | |
|
||
[*.{cmd, bat}] | ||
end_of_line = crlf | ||
|
||
csharp_style_namespace_declarations = file_scoped:suggestion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,38 @@ | ||
echo "build: Build started" | ||
Write-Output "build: Build started" | ||
|
||
Push-Location $PSScriptRoot | ||
|
||
if(Test-Path .\artifacts) { | ||
echo "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
Write-Output "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
} | ||
|
||
& dotnet restore --no-cache | ||
|
||
$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 "main" -and $revision -ne "local"] | ||
$commitHash = $(git rev-parse --short HEAD) | ||
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] | ||
|
||
echo "build: Package version suffix is $suffix" | ||
echo "build: Build version suffix is $buildSuffix" | ||
|
||
foreach ($src in gci src/*) { | ||
Push-Location $src | ||
|
||
echo "build: Packaging project in $src" | ||
|
||
& dotnet build -c Release --version-suffix=$buildSuffix | ||
|
||
if($suffix) { | ||
& dotnet pack -c Release --include-source --no-build -o ../../artifacts --version-suffix=$suffix -p:ContinuousIntegrationBuild=true | ||
} else { | ||
& dotnet pack -c Release --include-source --no-build -o ../../artifacts -p:ContinuousIntegrationBuild=true | ||
} | ||
if($LASTEXITCODE -ne 0) { exit 1 } | ||
Write-Output "build: Package version suffix is $suffix" | ||
Write-Output "build: Build version suffix is $buildSuffix" | ||
|
||
Pop-Location | ||
} | ||
|
||
foreach ($test in gci test/*.Tests) { | ||
Push-Location $test | ||
|
||
echo "build: Testing project in $test" | ||
& dotnet build --configuration Release --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true | ||
|
||
& dotnet test -c Release | ||
if($LASTEXITCODE -ne 0) { exit 3 } | ||
if($LASTEXITCODE -ne 0) { throw 'build failed' } | ||
|
||
Pop-Location | ||
if($suffix) { | ||
& dotnet pack src\Serilog.Settings.Configuration --configuration Release --no-build --no-restore -o artifacts --version-suffix=$suffix | ||
} else { | ||
& dotnet pack src\Serilog.Settings.Configuration --configuration Release --no-build --no-restore -o artifacts | ||
} | ||
|
||
foreach ($test in gci test/*.PerformanceTests) { | ||
Push-Location $test | ||
if($LASTEXITCODE -ne 0) { throw 'pack failed' } | ||
|
||
echo "build: Building performance test project in $test" | ||
Write-Output "build: Testing" | ||
|
||
& dotnet build -c Release | ||
if($LASTEXITCODE -ne 0) { exit 2 } | ||
|
||
Pop-Location | ||
} | ||
# Dotnet test doesn't run separate TargetFrameworks in parallel: https://github.com/dotnet/sdk/issues/19147 | ||
# Workaround: use `dotnet test` on dlls directly in order to pass the `--parallel` option to vstest. | ||
# The _reported_ runtime is wrong but the _actual_ used runtime is correct, see https://github.com/microsoft/vstest/issues/2037#issuecomment-720549173 | ||
& dotnet test test\Serilog.Settings.Configuration.Tests\bin\Release\*\Serilog.Settings.Configuration.Tests.dll --parallel | ||
|
||
Pop-Location | ||
if($LASTEXITCODE -ne 0) { throw 'unit tests failed' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"sdk": { | ||
"version": "7.0.201", | ||
"allowPrerelease": false, | ||
"rollForward": "latestFeature" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Serilog.Core; | ||
using Serilog.Events; | ||
|
||
namespace Sample; | ||
|
||
// The filter syntax in the sample configuration file is | ||
// processed by the Serilog.Filters.Expressions package. | ||
public class CustomFilter : ILogEventFilter | ||
{ | ||
readonly LogEventLevel _levelFilter; | ||
|
||
public CustomFilter(LogEventLevel levelFilter = LogEventLevel.Information) | ||
{ | ||
_levelFilter = levelFilter; | ||
} | ||
|
||
public bool IsEnabled(LogEvent logEvent) | ||
{ | ||
return logEvent.Level >= _levelFilter; | ||
} | ||
} |
Oops, something went wrong.