Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
root=true
root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.{csproj,json,config,yml}]
indent_size = 2
29 changes: 19 additions & 10 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,47 @@ if(Test-Path .\artifacts) {
$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 "master" -and $revision -ne "local"]
$commitHash = $(git rev-parse --short HEAD)
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]

echo "build: Version suffix is $suffix"
echo "build: Package version suffix is $suffix"
echo "build: Build version suffix is $buildSuffix"

foreach ($src in ls src/*) {
Push-Location $src

echo "build: Packaging project in $src"

& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix
& dotnet build -c Release --version-suffix=$buildSuffix

if($suffix) {
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts --version-suffix=$suffix
} else {
& dotnet pack -c Release --include-source --no-build -o ..\..\artifacts
}
if($LASTEXITCODE -ne 0) { exit 1 }

Pop-Location
}

foreach ($test in ls test/*.PerformanceTests) {
foreach ($test in ls test/*.Tests) {
Push-Location $test

echo "build: Building performance test project in $test"
echo "build: Testing project in $test"

& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }
& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }

Pop-Location
}

foreach ($test in ls test/*.Tests) {
foreach ($test in ls test/*.PerformanceTests) {
Push-Location $test

echo "build: Testing project in $test"
echo "build: Building performance test project in $test"

& dotnet test -c Release
if($LASTEXITCODE -ne 0) { exit 3 }
& dotnet build -c Release
if($LASTEXITCODE -ne 0) { exit 2 }

Pop-Location
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Log.Logger = new LoggerConfiguration()
.Subscribe())
.CreateLogger();

Log.Infomation("Hello, observers!");
Log.Information("Hello, observers!");

Log.CloseAndFlush();
```
Expand Down
10 changes: 2 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
version: '{build}'
skip_tags: true
image: Visual Studio 2015
image: Visual Studio 2017
configuration: Release
install:
- ps: mkdir -Force ".\build\" | Out-Null
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
- ps: '& .\build\installcli.ps1 -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath -Version 1.0.0-preview2-003121'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
test: off
build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/Serilog.*.nupkg
deploy:
Expand Down
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

40 changes: 22 additions & 18 deletions serilog-sinks-observable.sln
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
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
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
CHANGES.md = CHANGES.md
global.json = global.json
NuGet.Config = NuGet.Config
LICENSE = LICENSE
README.md = README.md
assets\Serilog.snk = assets\Serilog.snk
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Observable", "src\Serilog.Sinks.Observable\Serilog.Sinks.Observable.xproj", "{8D6C0BB9-D04D-49B6-9043-4A776AD275D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9D8490A7-A075-4E53-A5F2-A960CF4DB3E7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Observable", "src\Serilog.Sinks.Observable\Serilog.Sinks.Observable.csproj", "{727C1498-20A8-4C1A-BE5F-8AB762F920DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.csproj", "{C88A987D-3E79-481C-9DD7-441371EAF9E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8D6C0BB9-D04D-49B6-9043-4A776AD275D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D6C0BB9-D04D-49B6-9043-4A776AD275D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D6C0BB9-D04D-49B6-9043-4A776AD275D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D6C0BB9-D04D-49B6-9043-4A776AD275D5}.Release|Any CPU.Build.0 = Release|Any CPU
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.Build.0 = Release|Any CPU
{727C1498-20A8-4C1A-BE5F-8AB762F920DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{727C1498-20A8-4C1A-BE5F-8AB762F920DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{727C1498-20A8-4C1A-BE5F-8AB762F920DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{727C1498-20A8-4C1A-BE5F-8AB762F920DC}.Release|Any CPU.Build.0 = Release|Any CPU
{C88A987D-3E79-481C-9DD7-441371EAF9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C88A987D-3E79-481C-9DD7-441371EAF9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C88A987D-3E79-481C-9DD7-441371EAF9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C88A987D-3E79-481C-9DD7-441371EAF9E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8D6C0BB9-D04D-49B6-9043-4A776AD275D5} = {037440DE-440B-4129-9F7A-09B42D00397E}
{3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {9D8490A7-A075-4E53-A5F2-A960CF4DB3E7}
{727C1498-20A8-4C1A-BE5F-8AB762F920DC} = {037440DE-440B-4129-9F7A-09B42D00397E}
{C88A987D-3E79-481C-9DD7-441371EAF9E6} = {9D8490A7-A075-4E53-A5F2-A960CF4DB3E7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F7520405-4472-4800-B649-95134A0863F4}
EndGlobalSection
EndGlobal
22 changes: 22 additions & 0 deletions src/Serilog.Sinks.Observable/Serilog.Sinks.Observable.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>2.0.2</VersionPrefix>
<TargetFrameworks>net45;netstandard1.0</TargetFrameworks>
<AssemblyName>Serilog.Sinks.Observable</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Serilog.Sinks.Observable</PackageId>
<PackageTags>serilog;observable;reactive</PackageTags>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageProjectUrl>http://serilog.net</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.0.0" />
</ItemGroup>

</Project>
18 changes: 0 additions & 18 deletions src/Serilog.Sinks.Observable/Serilog.Sinks.Observable.xproj

This file was deleted.

11 changes: 5 additions & 6 deletions src/Serilog.Sinks.Observable/Sinks/Observable/ObservableSink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013-2016 Serilog Contributors
// Copyright 2013-2017 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,10 +38,8 @@ sealed class Unsubscriber : IDisposable

public Unsubscriber(ObservableSink sink, IObserver<LogEvent> observer)
{
if (sink == null) throw new ArgumentNullException(nameof(sink));
if (observer == null) throw new ArgumentNullException(nameof(observer));
_sink = sink;
_observer = observer;
_sink = sink ?? throw new ArgumentNullException(nameof(sink));
_observer = observer ?? throw new ArgumentNullException(nameof(observer));
}

public void Dispose()
Expand Down Expand Up @@ -124,11 +122,12 @@ public void Dispose()
{
if (_disposed) return;

_disposed = true;
foreach (var observer in _observers)
{
observer.OnCompleted();
}

_disposed = true;
}
}
}
Expand Down
26 changes: 0 additions & 26 deletions src/Serilog.Sinks.Observable/project.json

This file was deleted.

34 changes: 34 additions & 0 deletions test/Serilog.Tests/Serilog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>

<ItemGroup>
<None Include="App.config" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Observable\Serilog.Sinks.Observable.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />

<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />

<PackageReference Include="Rx-Main" Version="2.2.5" />
Copy link
Member

@ghuntley ghuntley Nov 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed to System.Reactive at version 3.11. Note Rx-Main is incompatible with System.Reactive and the same is true in inverse. FYI - The rest of the Reactive Extensions ecosystem has standardized using the netstandard release (System.Reactive @ 311). Any questions ask away!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will try to make those changes in dev when I have a chance 👍

Shouldn't hold up this release, as it's only in the test project. Merge ahoy!

<PackageReference Include="Serilog" Version="2.5.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System.Configuration" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

</Project>
28 changes: 0 additions & 28 deletions test/Serilog.Tests/Serilog.Tests.xproj

This file was deleted.

8 changes: 5 additions & 3 deletions test/Serilog.Tests/Sinks/Observable/ObservableSinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ public void EventsAreWrittenToObservers()
{
var eventSeen = false;

var log = new LoggerConfiguration()
using (var log = new LoggerConfiguration()
.WriteTo.Observers(events => events
.Do(evt => { eventSeen = true; })
.Subscribe())
.CreateLogger();
.CreateLogger())
{
log.Write(Some.InformationEvent());
}

log.Write(Some.InformationEvent());
Assert.True(eventSeen);
}
}
Expand Down
21 changes: 0 additions & 21 deletions test/Serilog.Tests/project.json

This file was deleted.