-
Notifications
You must be signed in to change notification settings - Fork 799
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 #2067 from serilog/dev
4.0.0 Release
Showing
83 changed files
with
1,694 additions
and
480 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
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 @@ | ||
{ | ||
"recommendations": [ | ||
"davidanson.vscode-markdownlint", | ||
"editorconfig.editorconfig", | ||
"ms-dotnettools.csdevkit" | ||
] | ||
} |
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 @@ | ||
{ | ||
"cSpell.words": [ | ||
"serilog" | ||
], | ||
"dotnet.defaultSolution": "Serilog.sln", | ||
"omnisharp.enableEditorConfigSupport": true | ||
} |
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,42 @@ | ||
{ | ||
"tasks": [ | ||
{ | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/Serilog.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"command": "dotnet", | ||
"group": { | ||
"isDefault": true, | ||
"kind": "build" | ||
}, | ||
"label": "build", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"problemMatcher": "$msCompile", | ||
"type": "shell" | ||
}, | ||
{ | ||
"args": [ | ||
"test", | ||
"${workspaceFolder}/Serilog.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary", | ||
"--filter", | ||
"FullyQualifiedName!~PerformanceTests" | ||
], | ||
"command": "dotnet", | ||
"group": { | ||
"isDefault": true, | ||
"kind": "test" | ||
}, | ||
"label": "test", | ||
"problemMatcher": "$msCompile", | ||
"type": "process" | ||
} | ||
], | ||
"version": "2.0.0" | ||
} |
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,39 +1,45 @@ | ||
Write-Output "build: Build started" | ||
|
||
Push-Location $PSScriptRoot | ||
try { | ||
|
||
if(Test-Path .\artifacts) { | ||
Write-Output "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
} | ||
if (Test-Path .\artifacts) { | ||
Write-Output "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
} | ||
|
||
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$NULL -ne $env:APPVEYOR_REPO_BRANCH]; | ||
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:APPVEYOR_BUILD_NUMBER]; | ||
$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 ""] | ||
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$NULL -ne $env:APPVEYOR_REPO_BRANCH]; | ||
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$NULL -ne $env:APPVEYOR_BUILD_NUMBER]; | ||
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)).Replace('/','-'))-$revision" }[$branch -eq "main" -and $revision -ne "local"] | ||
$commitHash = $(git rev-parse --short HEAD) | ||
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] | ||
|
||
Write-Output "build: Package version suffix is $suffix" | ||
Write-Output "build: Build version suffix is $buildSuffix" | ||
Write-Output "build: Package version suffix is $suffix" | ||
Write-Output "build: Build version suffix is $buildSuffix" | ||
|
||
& dotnet build --configuration Release --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true | ||
& dotnet build --configuration Release --version-suffix=$buildSuffix /p:ContinuousIntegrationBuild=true | ||
|
||
if($LASTEXITCODE -ne 0) { throw 'build failed' } | ||
if ($LASTEXITCODE -ne 0) { throw 'build failed' } | ||
|
||
if($suffix) { | ||
& dotnet pack src\Serilog --configuration Release --no-build --no-restore -o artifacts --version-suffix=$suffix | ||
} else { | ||
& dotnet pack src\Serilog --configuration Release --no-build --no-restore -o artifacts | ||
} | ||
if ($suffix) { | ||
& dotnet pack src\Serilog --configuration Release --no-build --no-restore -o artifacts --version-suffix=$suffix | ||
} | ||
else { | ||
& dotnet pack src\Serilog --configuration Release --no-build --no-restore -o artifacts | ||
} | ||
|
||
if($LASTEXITCODE -ne 0) { throw 'pack failed' } | ||
if ($LASTEXITCODE -ne 0) { throw 'pack failed' } | ||
|
||
Write-Output "build: Testing" | ||
Write-Output "build: Testing" | ||
|
||
& dotnet test test\Serilog.Tests --configuration Release --no-build --no-restore | ||
& dotnet test test\Serilog.Tests --configuration Release --no-build --no-restore | ||
|
||
if($LASTEXITCODE -ne 0) { throw 'unit tests failed' } | ||
if ($LASTEXITCODE -ne 0) { throw 'unit tests failed' } | ||
|
||
& dotnet test test\Serilog.ApprovalTests --configuration Release --no-build --no-restore | ||
& dotnet test test\Serilog.ApprovalTests --configuration Release --no-build --no-restore | ||
|
||
if($LASTEXITCODE -ne 0) { throw 'approval tests failed' } | ||
if ($LASTEXITCODE -ne 0) { throw 'approval tests failed' } | ||
} | ||
finally { | ||
Pop-Location | ||
} |
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
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,14 @@ | ||
|
||
namespace Serilog.Capturing; | ||
|
||
static class TrimConfiguration | ||
{ | ||
/// <summary> | ||
/// True if compiler-generated types are treated specially by Serilog during logging. The main example | ||
/// of this would be anonymous types, which have a special compiler-generated form. If this switch is | ||
/// disabled, Serilog will not be able to destructure anonymous types, but will still be able to log | ||
/// them as scalar values. | ||
/// </summary> | ||
public static bool IsCompilerGeneratedCodeSupported { get; } = | ||
!AppContext.TryGetSwitch("Serilog.Capturing.IsCompilerGeneratedCodeSupported", out var isEnabled) || isEnabled; | ||
} |
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,48 @@ | ||
// Copyright © Serilog Contributors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Serilog.Core.Sinks.Batching; | ||
|
||
namespace Serilog.Configuration; | ||
|
||
/// <summary> | ||
/// Initialization options for <see cref="BatchingSink"/>. | ||
/// </summary> | ||
public class BatchingOptions | ||
{ | ||
/// <summary> | ||
/// Eagerly emit a batch containing the first received event, regardless of | ||
/// the target batch size or batching time. This helps with perceived "liveness" | ||
/// when running/debugging applications interactively. The default is <c>true</c>. | ||
/// </summary> | ||
public bool EagerlyEmitFirstEvent { get; set; } = true; | ||
|
||
/// <summary> | ||
/// The maximum number of events to include in a single batch. The default is <c>1000</c>. | ||
/// </summary> | ||
public int BatchSizeLimit { get; set; } = 1000; | ||
|
||
/// <summary> | ||
/// The maximum delay between event batches. The default is two seconds. If a batch can be filled | ||
/// before the buffering time limit is reached, it will be emitted without waiting. | ||
/// </summary> | ||
public TimeSpan BufferingTimeLimit { get; set; } = TimeSpan.FromSeconds(2); | ||
|
||
/// <summary> | ||
/// Maximum number of events to hold in the sink's internal queue, or <c>null</c> | ||
/// for an unbounded queue. The default is <c>100000</c>. When the limit is exceeded, | ||
/// backpressure is applied. | ||
/// </summary> | ||
public int? QueueLimit { get; set; } = 100000; | ||
} |
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
Oops, something went wrong.