-
Notifications
You must be signed in to change notification settings - Fork 10
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 #18 from serilog/dev
2.0.2 Release
- Loading branch information
Showing
17 changed files
with
219 additions
and
76 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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,36 +1,47 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.24720.0 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30608.117 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}" | ||
ProjectSection(SolutionItems) = preProject | ||
Build.ps1 = Build.ps1 | ||
global.json = global.json | ||
NuGet.Config = NuGet.Config | ||
README.md = README.md | ||
assets\Serilog.snk = assets\Serilog.snk | ||
EndProjectSection | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Enrichers.Process", "src\Serilog.Enrichers.Process\Serilog.Enrichers.Process.xproj", "{2312A998-5E53-4355-9CB6-6014252B3E88}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Enrichers.Process", "src\Serilog.Enrichers.Process\Serilog.Enrichers.Process.csproj", "{E950BED9-A953-4555-9159-B40ABDE7DC90}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Enrichers.Process.Tests", "test\Serilog.Enrichers.Process.Tests\Serilog.Enrichers.Process.Tests.csproj", "{27336067-0A49-4053-9A57-76510C8D9097}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ACD52C07-EC24-4A6D-9DE4-653A6A89F74D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{2312A998-5E53-4355-9CB6-6014252B3E88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2312A998-5E53-4355-9CB6-6014252B3E88}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2312A998-5E53-4355-9CB6-6014252B3E88}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2312A998-5E53-4355-9CB6-6014252B3E88}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{E950BED9-A953-4555-9159-B40ABDE7DC90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E950BED9-A953-4555-9159-B40ABDE7DC90}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E950BED9-A953-4555-9159-B40ABDE7DC90}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{E950BED9-A953-4555-9159-B40ABDE7DC90}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{27336067-0A49-4053-9A57-76510C8D9097}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{27336067-0A49-4053-9A57-76510C8D9097}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{27336067-0A49-4053-9A57-76510C8D9097}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{27336067-0A49-4053-9A57-76510C8D9097}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{2312A998-5E53-4355-9CB6-6014252B3E88} = {037440DE-440B-4129-9F7A-09B42D00397E} | ||
{E950BED9-A953-4555-9159-B40ABDE7DC90} = {037440DE-440B-4129-9F7A-09B42D00397E} | ||
{27336067-0A49-4053-9A57-76510C8D9097} = {ACD52C07-EC24-4A6D-9DE4-653A6A89F74D} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {9BEC8B70-CA11-4400-AEAE-B0EAE15E933B} | ||
EndGlobalSection | ||
EndGlobal |
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
49 changes: 49 additions & 0 deletions
49
src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.csproj
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,49 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Description>The process enricher for Serilog.</Description> | ||
<VersionPrefix>2.0.2</VersionPrefix> | ||
<Authors>Serilog Contributors</Authors> | ||
<TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks> | ||
<AssemblyName>Serilog.Enrichers.Process</AssemblyName> | ||
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile> | ||
<SignAssembly>true</SignAssembly> | ||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | ||
<PackageId>Serilog.Enrichers.Process</PackageId> | ||
<PackageTags>serilog;process;enricher</PackageTags> | ||
<PackageIcon>serilog-enricher-nuget.png</PackageIcon> | ||
<PackageProjectUrl>http://serilog.net</PackageProjectUrl> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> | ||
<RepositoryUrl>https://github.com/serilog/serilog-enrichers-process</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Serilog" Version="2.3.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' "> | ||
<Reference Include="System" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' "> | ||
<PackageReference Include="System.Diagnostics.Process" Version="4.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\assets\serilog-enricher-nuget.png"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
18 changes: 0 additions & 18 deletions
18
src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.xproj
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
test/Serilog.Enrichers.Process.Tests/Enrichers/ProcessIdEnricherTests.cs
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,26 @@ | ||
using Serilog.Events; | ||
using Serilog.Tests.Support; | ||
using Xunit; | ||
|
||
namespace Serilog.Enrichers.Process.Tests | ||
{ | ||
public class ProcessIdEnricherTests | ||
{ | ||
[Fact] | ||
public void ProcessIdEnricherIsApplied() | ||
{ | ||
LogEvent evt = null; | ||
var log = new LoggerConfiguration() | ||
.Enrich.WithProcessId() | ||
.WriteTo.Sink(new DelegatingSink(e => evt = e)) | ||
.CreateLogger(); | ||
|
||
log.Information(@"Has a ProcessId property"); | ||
|
||
Assert.NotNull(evt); | ||
|
||
var processId = System.Diagnostics.Process.GetCurrentProcess().Id; | ||
Assert.Equal(processId, (int)evt.Properties["ProcessId"].LiteralValue()); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
test/Serilog.Enrichers.Process.Tests/Enrichers/ProcessNameEnricherTests.cs
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,26 @@ | ||
using Serilog.Events; | ||
using Serilog.Tests.Support; | ||
using Xunit; | ||
|
||
namespace Serilog.Enrichers.Process.Tests | ||
{ | ||
public class ProcessNameEnricherTests | ||
{ | ||
[Fact] | ||
public void ProcessNameEnricherIsApplied() | ||
{ | ||
LogEvent evt = null; | ||
var log = new LoggerConfiguration() | ||
.Enrich.WithProcessName() | ||
.WriteTo.Sink(new DelegatingSink(e => evt = e)) | ||
.CreateLogger(); | ||
|
||
log.Information(@"Has a ProcessName property"); | ||
|
||
Assert.NotNull(evt); | ||
|
||
var processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; | ||
Assert.Equal(processName, (string)evt.Properties["ProcessName"].LiteralValue()); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
test/Serilog.Enrichers.Process.Tests/Serilog.Enrichers.Process.Tests.csproj
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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net46</TargetFrameworks> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Serilog.Enrichers.Process\Serilog.Enrichers.Process.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
33 changes: 33 additions & 0 deletions
33
test/Serilog.Enrichers.Process.Tests/Support/DelegatingSink.cs
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,33 @@ | ||
using System; | ||
using Serilog.Core; | ||
using Serilog.Events; | ||
|
||
namespace Serilog.Tests.Support | ||
{ | ||
public class DelegatingSink : ILogEventSink | ||
{ | ||
readonly Action<LogEvent> _write; | ||
|
||
public DelegatingSink(Action<LogEvent> write) | ||
{ | ||
if (write == null) throw new ArgumentNullException(nameof(write)); | ||
_write = write; | ||
} | ||
|
||
public void Emit(LogEvent logEvent) | ||
{ | ||
_write(logEvent); | ||
} | ||
|
||
public static LogEvent GetLogEvent(Action<ILogger> writeAction) | ||
{ | ||
LogEvent result = null; | ||
var l = new LoggerConfiguration() | ||
.WriteTo.Sink(new DelegatingSink(le => result = le)) | ||
.CreateLogger(); | ||
|
||
writeAction(l); | ||
return result; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
test/Serilog.Enrichers.Process.Tests/Support/Extensions.cs
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,12 @@ | ||
using Serilog.Events; | ||
|
||
namespace Serilog.Tests.Support | ||
{ | ||
public static class Extensions | ||
{ | ||
public static object LiteralValue(this LogEventPropertyValue @this) | ||
{ | ||
return ((ScalarValue)@this).Value; | ||
} | ||
} | ||
} |
Empty file.