Skip to content

Commit

Permalink
Remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Nov 28, 2019
1 parent 33eced9 commit 6668377
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/TuringMachine/RPC/RpcServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Diagnostics;
using System.IO.Compression;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -114,6 +116,25 @@ public void Start()
SerializationHelper.Configure(c.SerializerSettings);
});
services.AddLogging(builder =>
{
if (Debugger.IsAttached)
{
builder
.ClearProviders()
.AddConsole();
}
else
{
builder
.ClearProviders()
.AddFilter("Microsoft", LogLevel.Warning)
.AddFilter("System", LogLevel.Warning)
.AddFilter("NToastNotify", LogLevel.Warning)
.AddEventLog();
}
});
services.AddResponseCompression(options =>
{
// options.EnableForHttps = false;
Expand Down

0 comments on commit 6668377

Please sign in to comment.