Skip to content

Commit ac58f7c

Browse files
committed
Add option to deactivate logging
1 parent 76b2b84 commit ac58f7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Add
99
- Link interception for image links
10+
- Option activate/deactivate logging of the host
1011

1112
## [0.5.4] - 2020-04-29
1213
### Add

src/SharpWebview/Content/HostedContent.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
using Microsoft.AspNetCore.Hosting.Server.Features;
99
using Microsoft.Extensions.DependencyInjection;
1010
using Microsoft.Extensions.FileProviders;
11+
using Microsoft.Extensions.Logging;
1112

1213
namespace SharpWebview.Content
1314
{
1415
public sealed class HostedContent : IWebviewContent
1516
{
1617
private readonly IWebHost _webHost;
1718

18-
public HostedContent(int port = 0)
19+
public HostedContent(int port = 0, bool activateLog = false)
1920
{
2021
_webHost = WebHost.CreateDefaultBuilder()
2122
.UseStartup<Startup>()
2223
.UseKestrel(options => options.Listen(IPAddress.Loopback, port))
24+
.ConfigureLogging((logger) => { if(!activateLog) logger.ClearProviders(); })
2325
.Build();
2426
_webHost.Start();
2527
}

0 commit comments

Comments
 (0)