Skip to content

Commit 2a0f0df

Browse files
authored
Merge pull request #4 from serilog/dev
2.1.0 release
2 parents f9d3fb2 + 0d91aae commit 2a0f0df

File tree

10 files changed

+129
-17
lines changed

10 files changed

+129
-17
lines changed

Build.ps1

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@ Push-Location $PSScriptRoot
22

33
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
44

5-
& dotnet restore
5+
& dotnet restore --no-cache
66

7-
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
7+
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
8+
$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"]
810

9-
Push-Location src/Serilog.Sinks.Console
11+
foreach ($src in ls src/Serilog.*) {
12+
Push-Location $src
1013

11-
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$revision
12-
if($LASTEXITCODE -ne 0) { exit 1 }
14+
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix
15+
if($LASTEXITCODE -ne 0) { exit 1 }
16+
17+
Pop-Location
18+
}
19+
20+
foreach ($test in ls test/Serilog.*.Tests) {
21+
Push-Location $test
22+
23+
& dotnet test -c Release
24+
if($LASTEXITCODE -ne 0) { exit 2 }
25+
26+
Pop-Location
27+
}
1328

1429
Pop-Location
15-
Pop-Location

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ deploy:
1919
secure: nvZ/z+pMS91b3kG4DgfES5AcmwwGoBYQxr9kp4XiJHj25SAlgdIxFx++1N0lFH2x
2020
skip_symbols: true
2121
on:
22-
branch: /^(master)$/
22+
branch: /^(master|dev)$/
2323
- provider: GitHub
2424
auth_token:
25-
secure: Bo3ypKpKFxinjR9ShkNekNvkob2iklHJU+UlYyfHtcFFIAa58SV2TkEd0xWxz633
25+
secure: p4LpVhBKxGS5WqucHxFQ5c7C8cP74kbNB0Z8k9Oxx/PMaDQ1+ibmoexNqVU5ZlmX
2626
artifact: /Serilog.*\.nupkg/
2727
tag: v$(appveyor_build_version)
2828
on:
29-
branch: master
29+
branch: master

global.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"projects": [ "src", "test" ],
3-
"sdk": {
4-
"version": "1.0.0-rc1-final"
5-
}
2+
"projects": [ "src", "test" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003121"
5+
}
66
}

Serilog.Sinks.Console.sln renamed to serilog-sinks-console.sln

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
77
EndProject
@@ -16,6 +16,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5
1616
EndProject
1717
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Console", "src\Serilog.Sinks.Console\Serilog.Sinks.Console.xproj", "{866A028E-27DB-49A0-AC78-E5FEF247C099}"
1818
EndProject
19+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7D0692CD-F95D-4BF9-8C63-B4A1C078DF23}"
20+
EndProject
21+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Console.Tests", "test\Serilog.Sinks.Console.Tests\Serilog.Sinks.Console.Tests.xproj", "{1D56534C-4009-42C2-A573-789CAE6B8AA9}"
22+
EndProject
1923
Global
2024
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2125
Debug|Any CPU = Debug|Any CPU
@@ -26,11 +30,16 @@ Global
2630
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Debug|Any CPU.Build.0 = Debug|Any CPU
2731
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Release|Any CPU.ActiveCfg = Release|Any CPU
2832
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{1D56534C-4009-42C2-A573-789CAE6B8AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{1D56534C-4009-42C2-A573-789CAE6B8AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{1D56534C-4009-42C2-A573-789CAE6B8AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{1D56534C-4009-42C2-A573-789CAE6B8AA9}.Release|Any CPU.Build.0 = Release|Any CPU
2937
EndGlobalSection
3038
GlobalSection(SolutionProperties) = preSolution
3139
HideSolutionNode = FALSE
3240
EndGlobalSection
3341
GlobalSection(NestedProjects) = preSolution
3442
{866A028E-27DB-49A0-AC78-E5FEF247C099} = {037440DE-440B-4129-9F7A-09B42D00397E}
43+
{1D56534C-4009-42C2-A573-789CAE6B8AA9} = {7D0692CD-F95D-4BF9-8C63-B4A1C078DF23}
3544
EndGlobalSection
3645
EndGlobal

src/Serilog.Sinks.Console/ConsoleLoggerConfigurationExtensions.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Serilog.Configuration;
33
using Serilog.Core;
44
using Serilog.Events;
5+
using Serilog.Formatting;
56
using Serilog.Formatting.Display;
67
using Serilog.Sinks.SystemConsole;
78

@@ -36,6 +37,28 @@ public static LoggerConfiguration Console(
3637
if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration));
3738
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
3839
var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider);
40+
return Console(sinkConfiguration, formatter, restrictedToMinimumLevel, levelSwitch);
41+
}
42+
43+
/// <summary>
44+
/// Writes log events to <see cref="System.Console"/>.
45+
/// </summary>
46+
/// <param name="sinkConfiguration">Logger sink configuration.</param>
47+
/// <param name="formatter">Controls the rendering of log events into text, for example to log JSON. To
48+
/// control plain text formatting, use the overload that accepts an output template.</param>
49+
/// <param name="restrictedToMinimumLevel">The minimum level for
50+
/// events passed through the sink. Ignored when <paramref name="levelSwitch"/> is specified.</param>
51+
/// <param name="levelSwitch">A switch allowing the pass-through minimum level
52+
/// to be changed at runtime.</param>
53+
/// <returns>Configuration object allowing method chaining.</returns>
54+
public static LoggerConfiguration Console(
55+
this LoggerSinkConfiguration sinkConfiguration,
56+
ITextFormatter formatter,
57+
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
58+
LoggingLevelSwitch levelSwitch = null)
59+
{
60+
if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration));
61+
if (formatter == null) throw new ArgumentNullException(nameof(formatter));
3962
return sinkConfiguration.Sink(new ConsoleSink(formatter), restrictedToMinimumLevel, levelSwitch);
4063
}
4164
}

src/Serilog.Sinks.Console/Serilog.Sinks.Console.xproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<ProjectGuid>866a028e-27db-49a0-ac78-e5fef247c099</ProjectGuid>
1010
<RootNamespace>Serilog</RootNamespace>
1111
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12-
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
1313
</PropertyGroup>
1414
<PropertyGroup>
1515
<SchemaVersion>2.0</SchemaVersion>
1616
</PropertyGroup>
17-
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
17+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
1818
</Project>

src/Serilog.Sinks.Console/project.json

Lines changed: 1 addition & 1 deletion
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 console sink for Serilog.",
44
"authors": [
55
"Serilog Contributors"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyConfiguration("")]
9+
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyProduct("Serilog.Sinks.Trace.Tests")]
11+
[assembly: AssemblyTrademark("")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
// The following GUID is for the ID of the typelib if this project is exposed to COM
19+
[assembly: Guid("1d56534c-4009-42c2-a573-789cae6b8aa9")]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>1d56534c-4009-42c2-a573-789cae6b8aa9</ProjectGuid>
11+
<RootNamespace>Serilog.Sinks.Trace.Tests</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"testRunner": "xunit",
3+
4+
"dependencies": {
5+
"NETStandard.Library": "1.6.0",
6+
"dotnet-test-xunit": "1.0.0-rc2-build10025",
7+
"xunit": "2.1.0",
8+
"Serilog.Sinks.Console": { "target": "project" }
9+
},
10+
11+
"frameworks": {
12+
"net4.5.2": {},
13+
"netcoreapp1.0": {
14+
"dependencies": {
15+
"Microsoft.NETCore.App": {
16+
"type": "platform",
17+
"version": "1.0.0"
18+
}
19+
},
20+
"imports": [
21+
"dnxcore50",
22+
"portable-net45+win8"
23+
]
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)