Skip to content

Commit 66566cd

Browse files
Ensure that we still call ILogger.IsEnabled(...)
1 parent b4bdfe0 commit 66566cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Logging/AbstractLoggerFactory.AggregateLogger.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ public bool IsEnabled(LogLevel logLevel)
1919
{
2020
// If the ILoggerProvider's metadata has a minimum log level, we can use that
2121
// rather than forcing the ILoggerProvider to be created.
22-
if (_metadata.MinimumLogLevel is LogLevel minimumLogLevel)
22+
if (_metadata.MinimumLogLevel is LogLevel minimumLogLevel &&
23+
!logLevel.IsAtLeast(minimumLogLevel))
2324
{
24-
return logLevel.IsAtLeast(minimumLogLevel);
25+
return false;
2526
}
2627

2728
return Instance.IsEnabled(logLevel);

0 commit comments

Comments
 (0)