Disable writing to console if exceptions are expected

This commit is contained in:
John Luo 2018-04-23 12:07:51 -07:00
parent ee3ee4eb94
commit 1655a8fd6d
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Testing
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
#if true
if (logLevel == LogLevel.Critical && ThrowOnCriticalErrors)
if (logLevel == LogLevel.Critical && ThrowOnCriticalErrors && !IgnoredExceptions.Contains(exception.GetType()))
#endif
{
var log = $"Log {logLevel}[{eventId}]: {formatter(state, exception)} {exception}";