feat: limit aspnetcore logging level to error on release builds

This commit is contained in:
genteure 2022-09-03 23:11:47 +08:00
parent e0cd372efc
commit 05c347e0fc

View File

@ -201,8 +201,14 @@ namespace BililiveRecorder.Cli
}
else
{
#if DEBUG
const LogEventLevel webLogEventLevel = LogEventLevel.Debug;
#else
const LogEventLevel webLogEventLevel = LogEventLevel.Error;
#endif
host = new HostBuilder()
.UseSerilog(logger: logger)
.UseSerilog(logger: new LoggerConfiguration().MinimumLevel.Is(webLogEventLevel).WriteTo.Logger(logger).CreateLogger(), dispose: true)
.ConfigureServices(services =>
{
services.AddSingleton(recorderAccessProxy);