Skip to content

Commit

Permalink
Nuke nlog.
Browse files Browse the repository at this point in the history
  • Loading branch information
peters committed Jan 27, 2024
1 parent 09c4442 commit d0a0b58
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Tests\Digipost.Api.Client.Tests.csproj"/>
<ProjectReference Include="..\Digipost.Api.Client\Digipost.Api.Client.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ProjectReference Include="..\Digipost.Api.Client.Common\Digipost.Api.Client.Common.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Tests\Digipost.Api.Client.Tests.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ItemGroup>
<PackageReference Include="Digipost.Api.Client.Shared" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="NLog.Extensions.Logging" />
<PackageReference Include="System.ComponentModel.Annotations" />
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj"/>
</ItemGroup>
Expand Down
28 changes: 0 additions & 28 deletions Digipost.Api.Client.Common/nlog.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Tests\Digipost.Api.Client.Tests.csproj" />
<ProjectReference Include="..\Digipost.Api.Client\Digipost.Api.Client.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Send\Digipost.Api.Client.Send.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Tests\Digipost.Api.Client.Tests.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="NLog.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<ProjectReference Include="..\Digipost.Api.Client.Resources\Digipost.Api.Client.Resources.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Send\Digipost.Api.Client.Send.csproj" />
<ProjectReference Include="..\Digipost.Api.Client\Digipost.Api.Client.csproj" />
<ProjectReference Include="..\Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
Expand All @@ -15,10 +14,8 @@
using Digipost.Api.Client.Resources.Certificate;
using Digipost.Api.Client.Resources.Xml;
using Digipost.Api.Client.Send;
using Digipost.Api.Client.Shared.Tests;
using Digipost.Api.Client.Tests.Fakes;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
using Environment = Digipost.Api.Client.Common.Environment;

Expand All @@ -45,9 +42,8 @@ internal HttpClient GetHttpClient(
FakeResponseHandler fakehandler)
{
ClientConfig.LogRequestAndResponse = true;
var serviceProvider = LoggingUtility.CreateServiceProviderAndSetUpLogging();

var allDelegationHandlers = new List<DelegatingHandler> { new AuthenticationHandler(ClientConfig, Certificate, serviceProvider.GetService<ILoggerFactory>()) };
var allDelegationHandlers = new List<DelegatingHandler> { new AuthenticationHandler(ClientConfig, Certificate, new NullLoggerFactory()) };

var httpClient = HttpClientFactory.Create(
fakehandler,
Expand All @@ -62,10 +58,8 @@ internal HttpClient GetHttpClient(
SendMessageApi GetDigipostApi(FakeResponseHandler fakeResponseHandler)
{
var httpClient = GetHttpClient(fakeResponseHandler);

var serviceProvider = LoggingUtility.CreateServiceProviderAndSetUpLogging();

var requestHelper = new RequestHelper(httpClient, serviceProvider.GetService<ILoggerFactory>()) { HttpClient = httpClient };

var requestHelper = new RequestHelper(httpClient, new NullLoggerFactory()) { HttpClient = httpClient };

var links = new Dictionary<string, Link>
{
Expand All @@ -78,7 +72,7 @@ SendMessageApi GetDigipostApi(FakeResponseHandler fakeResponseHandler)
Links = links
};

var digipostApi = new SendMessageApi(new SendRequestHelper(requestHelper), serviceProvider.GetService<ILoggerFactory>(), root);
var digipostApi = new SendMessageApi(new SendRequestHelper(requestHelper), new NullLoggerFactory(), root);
return digipostApi;
}

Expand Down
6 changes: 0 additions & 6 deletions digipost-api-client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Send.Te
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Tests", "Digipost.Api.Client.Tests\Digipost.Api.Client.Tests.csproj", "{966A701B-7E91-4C41-BA28-B5C5E800E63D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Shared.Tests", "Digipost.Api.Client.Shared.Tests\Digipost.Api.Client.Shared.Tests.csproj", "{A4322FAD-E7DB-4D2D-A1A8-2A7A893A2FAA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -80,9 +78,5 @@ Global
{966A701B-7E91-4C41-BA28-B5C5E800E63D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{966A701B-7E91-4C41-BA28-B5C5E800E63D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{966A701B-7E91-4C41-BA28-B5C5E800E63D}.Release|Any CPU.Build.0 = Release|Any CPU
{A4322FAD-E7DB-4D2D-A1A8-2A7A893A2FAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4322FAD-E7DB-4D2D-A1A8-2A7A893A2FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4322FAD-E7DB-4D2D-A1A8-2A7A893A2FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4322FAD-E7DB-4D2D-A1A8-2A7A893A2FAA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

0 comments on commit d0a0b58

Please sign in to comment.