控制台应用程序项目..在我的代码中我想隐藏控制台中的错误,如何在没有隐藏信息和警告的情况下执行此操作
return logger.MinimumLevel.Verbose()
.MinimumLevel.Override("Microsoft", LogEventLevel.Verbose)
.Filter.ByIncludingOnly(Serilog.Filters.Matching.FromSource<Transformer>())
.Enrich.FromLogContext()
.WriteTo.Console(LogEventLevel.Information)
.WriteTo.Async(config => config.File(Path.Combine(logsPath, runId + "-logFileName.log"),
rollOnFileSizeLimit: true,
fileSizeLimitBytes: 314572800));
return logger.MinimumLevel.Verbose()
.MinimumLevel.Override("Microsoft", LogEventLevel.Verbose)
.Filter.ByIncludingOnly(Serilog.Filters.Matching.FromSource<Transformer>())
.Enrich.FromLogContext()
.WriteTo.Logger(lc => lc
.Filter.ByIncludingOnly(le => le.Level == LogEventLevel.Information || le.Level == LogEventLevel.Warning)
.WriteTo.Console(LogEventLevel.Information))
.WriteTo.Async(config =>
config.File(
Path.Combine(logsPath, runId + "-logFileName.log"),
rollOnFileSizeLimit: true,
fileSizeLimitBytes: 314572800));