Skip to content

Commit 5774b16

Browse files
authored
Merge pull request #6 from serilog/dev
2.1.0 Release
2 parents f17b0b6 + 26e5934 commit 5774b16

File tree

5 files changed

+68
-20
lines changed

5 files changed

+68
-20
lines changed

Diff for: Build.ps1

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
1+
echo "build: Build started"
2+
13
Push-Location $PSScriptRoot
24

3-
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
5+
if(Test-Path .\artifacts) {
6+
echo "build: Cleaning .\artifacts"
7+
Remove-Item .\artifacts -Force -Recurse
8+
}
49

510
& dotnet restore --no-cache
611

712
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
813
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
9-
$suffix = @{ $true = ""; $false = "$branch-$revision"}[$branch -eq "master" -and $revision -ne "local"]
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
1015

11-
foreach ($src in ls src/Serilog.*) {
16+
echo "build: Version suffix is $suffix"
17+
18+
foreach ($src in ls src/*) {
1219
Push-Location $src
1320

14-
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix
21+
echo "build: Packaging project in $src"
22+
23+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
1524
if($LASTEXITCODE -ne 0) { exit 1 }
1625

1726
Pop-Location
1827
}
1928

20-
foreach ($test in ls test/Serilog.*.Tests) {
29+
foreach ($test in ls test/*.PerformanceTests) {
2130
Push-Location $test
2231

23-
& dotnet test -c Release
32+
echo "build: Building performance test project in $test"
33+
34+
& dotnet build -c Release
2435
if($LASTEXITCODE -ne 0) { exit 2 }
2536

2637
Pop-Location
2738
}
2839

40+
foreach ($test in ls test/*.Tests) {
41+
Push-Location $test
42+
43+
echo "build: Testing project in $test"
44+
45+
& dotnet test -c Release
46+
if($LASTEXITCODE -ne 0) { exit 3 }
47+
48+
Pop-Location
49+
}
50+
2951
Pop-Location

Diff for: README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
# Serilog.Sinks.Trace
1+
# Serilog.Sinks.Trace [![Build status](https://ci.appveyor.com/api/projects/status/v1oe03lx3wymyy7j/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-trace/branch/master) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Trace.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Trace/)
22

3-
The diagnostic trace sink for Serilog.
4-
5-
[![Build status](https://ci.appveyor.com/api/projects/status/v1oe03lx3wymyy7j/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-trace/branch/master) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Trace.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Trace/)
6-
7-
Writes log events to the `System.Diagnostics.Trace`.
3+
Writes [Serilog](https://serilog.net) events to `System.Diagnostics.Trace`.
84

95
```csharp
106
var log = new LoggerConfiguration()
@@ -14,4 +10,4 @@ var log = new LoggerConfiguration()
1410

1511
* [Documentation](https://github.com/serilog/serilog/wiki)
1612

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

Diff for: Serilog.Sinks.Trace.sln renamed to serilog-sinks-trace.sln

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
99
ProjectSection(SolutionItems) = preProject
10-
Build.ps1 = Build.ps1
11-
global.json = global.json
12-
NuGet.Config = NuGet.Config
13-
README.md = README.md
1410
assets\Serilog.snk = assets\Serilog.snk
1511
EndProjectSection
1612
EndProject
@@ -20,6 +16,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{5C546512-0
2016
EndProject
2117
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Trace.Tests", "test\Serilog.Sinks.Trace.Tests\Serilog.Sinks.Trace.Tests.xproj", "{1D56534C-4009-42C2-A573-789CAE6B8AA9}"
2218
EndProject
19+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{EF92FCAF-D99B-43B1-98AA-6ABE30E3AD7E}"
20+
ProjectSection(SolutionItems) = preProject
21+
appveyor.yml = appveyor.yml
22+
Build.ps1 = Build.ps1
23+
global.json = global.json
24+
NuGet.Config = NuGet.Config
25+
README.md = README.md
26+
EndProjectSection
27+
EndProject
2328
Global
2429
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2530
Debug|Any CPU = Debug|Any CPU

Diff for: src/Serilog.Sinks.Trace/TraceLoggerConfigurationExtensions.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
using Serilog.Events;
2020
using Serilog.Formatting.Display;
2121
using Serilog.Sinks.DiagnosticTrace;
22+
using Serilog.Formatting;
23+
using Serilog.Formatting.Json;
2224

2325
namespace Serilog
2426
{
@@ -51,7 +53,30 @@ public static LoggerConfiguration Trace(
5153
if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration));
5254
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
5355
var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
56+
return Trace(sinkConfiguration, formatter, restrictedToMinimumLevel, levelSwitch);
57+
}
58+
59+
/// <summary>
60+
/// Write log events to the <see cref="System.Diagnostics.Trace"/>.
61+
/// </summary>
62+
/// <param name="sinkConfiguration">Logger sink configuration.</param>
63+
/// <param name="restrictedToMinimumLevel">The minimum level for
64+
/// events passed through the sink. Ignored when <paramref name="levelSwitch"/> is specified.</param>
65+
/// <param name="levelSwitch">A switch allowing the pass-through minimum level
66+
/// to be changed at runtime.</param>
67+
/// <param name="formatter">A custom formatter to apply to the output events. This can be used with
68+
/// e.g. <see cref="JsonFormatter"/> to produce JSON output. To customize the text layout only, use the
69+
/// overload that accepts an output template instead.</param>
70+
/// <returns>Configuration object allowing method chaining.</returns>
71+
public static LoggerConfiguration Trace(
72+
this LoggerSinkConfiguration sinkConfiguration,
73+
ITextFormatter formatter,
74+
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
75+
LoggingLevelSwitch levelSwitch = null)
76+
{
77+
if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration));
78+
if (formatter == null) throw new ArgumentNullException(nameof(formatter));
5479
return sinkConfiguration.Sink(new TraceSink(formatter), restrictedToMinimumLevel, levelSwitch);
5580
}
5681
}
57-
}
82+
}

Diff for: src/Serilog.Sinks.Trace/project.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-*",
2+
"version": "2.1.0-*",
33
"description": "The diagnostic trace sink for Serilog.",
44
"authors": [
55
"Serilog Contributors"
@@ -30,4 +30,4 @@
3030
}
3131
}
3232
}
33-
}
33+
}

0 commit comments

Comments
 (0)