Ensure blazor client side logger checks for enabled log levels (#12928)

This commit is contained in:
Alessandro Ghidini 2019-09-09 10:34:20 +02:00 committed by Steve Sanderson
parent e7016bc67a
commit 1ea43c5492
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,11 @@ namespace Microsoft.AspNetCore.Blazor.Services
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
{
if (!IsEnabled(logLevel))
{
return;
}
var formattedMessage = formatter(state, exception);
Console.WriteLine($"[{logLevel}] {formattedMessage}");
}