Skip to content

Commit

Permalink
Merged Nlog.Extensions.Configuration into NLog.Extension.Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot committed Oct 21, 2018
1 parent ac1dacc commit 03c30fd
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 300 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ install:
# Restore dependencies
- dotnet restore src/NLog.Extensions.Logging
- dotnet restore src/NLog.Extensions.Hosting
- dotnet restore src/NLog.Extensions.Configuration
- dotnet restore test/NLog.Extensions.Hosting.Tests
- dotnet restore test/NLog.Extensions.Logging.Tests
- dotnet restore test/NLog.Extensions.Configuration.Tests

script:
# Run tests
- dotnet test test/NLog.Extensions.Hosting.Tests --configuration Release --framework netcoreapp2.0
- dotnet test test/NLog.Extensions.Logging.Tests --configuration Release --framework netcoreapp2.0
- dotnet test test/NLog.Extensions.Configuration.Tests --configuration Release --framework netcoreapp2.0

14 changes: 0 additions & 14 deletions NLog.Extensions.Logging.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLog.Extensions.Logging.Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostingExample", "examples\NetCore2\HostingExample\HostingExample.csproj", "{07D358DF-D77A-434B-B034-95785DF7106F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLog.Extensions.Configuration", "src\NLog.Extensions.Configuration\NLog.Extensions.Configuration.csproj", "{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extensions.Configuration.Tests", "test\NLog.Extensions.Configuration.Tests\NLog.Extensions.Configuration.Tests.csproj", "{78A9081B-066B-4B34-BBD7-764D53CE4AA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -54,14 +50,6 @@ Global
{07D358DF-D77A-434B-B034-95785DF7106F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07D358DF-D77A-434B-B034-95785DF7106F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07D358DF-D77A-434B-B034-95785DF7106F}.Release|Any CPU.Build.0 = Release|Any CPU
{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B}.Release|Any CPU.Build.0 = Release|Any CPU
{78A9081B-066B-4B34-BBD7-764D53CE4AA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78A9081B-066B-4B34-BBD7-764D53CE4AA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78A9081B-066B-4B34-BBD7-764D53CE4AA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78A9081B-066B-4B34-BBD7-764D53CE4AA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -73,8 +61,6 @@ Global
{0DC000BA-2DF8-48E5-A7BC-D76CB9D3FC61} = {FBD2E07B-F25B-4D2F-AEF6-6D1E10F1E523}
{DC42BF57-6316-4FCA-AD33-48FFDAFB4712} = {FBD2E07B-F25B-4D2F-AEF6-6D1E10F1E523}
{07D358DF-D77A-434B-B034-95785DF7106F} = {BD106966-02BE-4137-B9DC-4ECE56B4C204}
{AE82D026-CE85-48CC-BFFE-2D5C1556CC2B} = {C21FD102-21B1-46DB-AD62-86692558AD01}
{78A9081B-066B-4B34-BBD7-764D53CE4AA3} = {FBD2E07B-F25B-4D2F-AEF6-6D1E10F1E523}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46DF0C22-7B6A-4A64-BC63-7B2F6A14F334}
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ test_script:
- nuget.exe install OpenCover -ExcludeVersion -DependencyVersion Ignore
- OpenCover\tools\OpenCover.Console.exe -register:user -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test -f netcoreapp1.1 NLog.Extensions.Logging.Tests" -filter:"+[NLog.Extensions.Logging]* +[NLog.Extensions.Hosting]* -[NLog.Extensions.Logging.Tests]* -[NLog.Extensions.Hosting.Tests]*" -output:"coverage.xml" -oldstyle -targetdir:"test"
- OpenCover\tools\OpenCover.Console.exe -register:user -mergeoutput -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test -f netcoreapp2.0 NLog.Extensions.Logging.Tests" -filter:"+[NLog.Extensions.Logging]* -[NLog.Extensions.Logging.Tests]*" -output:"coverage.xml" -oldstyle -targetdir:"test"
- OpenCover\tools\OpenCover.Console.exe -register:user -mergeoutput -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test -f netcoreapp2.0 NLog.Extensions.Configuration.Tests" -filter:"+[NLog.Extensions.Logging]* +[NLog.Extensions.Configuration]* -[NLog.Extensions.Logging.Tests]* -[NLog.Extensions.Configuration.Tests]*" -output:"coverage.xml" -oldstyle -targetdir:"test"
- OpenCover\tools\OpenCover.Console.exe -register:user -mergeoutput -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test -f netcoreapp2.0 NLog.Extensions.Hosting.Tests" -filter:"+[NLog.Extensions.Logging]* +[NLog.Extensions.Hosting]* +[NLog.Extensions.Configuration]* -[NLog.Extensions.Logging.Tests]* -[NLog.Extensions.Hosting.Tests]* -[NLog.Extensions.Configuration.Tests]*" -output:"coverage.xml" -oldstyle -targetdir:"test"
- OpenCover\tools\OpenCover.Console.exe -register:user -mergeoutput -target:"C:/Program Files/dotnet/dotnet.exe" -targetargs:"test -f netcoreapp2.0 NLog.Extensions.Hosting.Tests" -filter:"+[NLog.Extensions.Logging]* +[NLog.Extensions.Hosting]* -[NLog.Extensions.Logging.Tests]* -[NLog.Extensions.Hosting.Tests]*" -output:"coverage.xml" -oldstyle -targetdir:"test"
- pip install codecov
- codecov -f "coverage.xml"
- ps: .\run-sonar.ps1
Expand Down
9 changes: 0 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ dotnet restore .\src\NLog.Extensions.Hosting\
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

dotnet restore .\src\NLog.Extensions.Configuration\
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

msbuild /t:Pack .\src\NLog.Extensions.Logging\ /p:targetFrameworks='"net451;net461;netstandard1.3;netstandard1.5;netstandard2.0"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:PackageOutputPath=..\..\artifacts /verbosity:minimal
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }
Expand All @@ -29,9 +25,4 @@ msbuild /t:Pack .\src\NLog.Extensions.Hosting\ /p:targetFrameworks='"netstandard
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

msbuild /t:Pack .\src\NLog.Extensions.Configuration\ /p:targetFrameworks='"net451;net461;netstandard1.3;netstandard1.5;netstandard2.0"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:PackageOutputPath=..\..\artifacts /verbosity:minimal
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }


exit $LastExitCode
6 changes: 3 additions & 3 deletions examples/NetCore2/ConsoleExample/ConsoleExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\NLog.Extensions.Configuration\NLog.Extensions.Configuration.csproj" />
<ProjectReference Include="..\..\..\src\NLog.Extensions.Logging\NLog.Extensions.Logging.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 12 additions & 1 deletion run-tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
dotnet restore test/NLog.Extensions.Logging.Tests -v minimal
dotnet restore test/NLog.Extensions.Hosting.Tests -v minimal
dotnet build test/NLog.Extensions.Logging.Tests --configuration release -v minimal
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

dotnet build test/NLog.Extensions.Hosting.Tests --configuration release -v minimal
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

dotnet test test/NLog.Extensions.Logging.Tests --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

dotnet test test/NLog.Extensions.Hosting.Tests --configuration release
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

exit $LASTEXITCODE
exit $LastExitCode
116 changes: 0 additions & 116 deletions src/NLog.Extensions.Configuration/Extensions/ConfigureExtensions.cs

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions src/NLog.Extensions.Configuration/Properties/AssemblyInfo.cs

This file was deleted.

8 changes: 6 additions & 2 deletions src/NLog.Extensions.Hosting/Extensions/ConfigureExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ public static IHostBuilder UseNLog(this IHostBuilder builder, NLogProviderOption

services.AddSingleton<ILoggerProvider>(serviceProvider =>
{
var provider = new NLogLoggerProvider(options);
var provider = new NLogLoggerProvider(options ?? new NLogProviderOptions());
if (hostbuilder.Configuration != null)
provider.ConfigureNLogProvider(hostbuilder.Configuration);
{
ConfigSettingLayoutRenderer.DefaultConfiguration = hostbuilder.Configuration;
if (options == null)
provider.ConfigureNLogProvider(hostbuilder.Configuration?.GetSection("Logging:NLog"));
}
return provider;
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/NLog.Extensions.Hosting/NLog.Extensions.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
<AssemblyOriginatorKeyFile>..\NLog.snk</AssemblyOriginatorKeyFile>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NLog.Extensions.Configuration\NLog.Extensions.Configuration.csproj" />
<ProjectReference Include="..\NLog.Extensions.Logging\NLog.Extensions.Logging.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 03c30fd

Please sign in to comment.