Skip to content

Commit

Permalink
Remove redundant static ctor from LoggerFactory (dotnet#48478)
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar authored Feb 19, 2021
1 parent 040ffb5 commit e6cc4ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace Microsoft.Extensions.Logging
/// </summary>
public class LoggerFactory : ILoggerFactory
{
private static readonly LoggerRuleSelector RuleSelector = new LoggerRuleSelector();

private readonly Dictionary<string, Logger> _loggers = new Dictionary<string, Logger>(StringComparer.Ordinal);
private readonly List<ProviderRegistration> _providerRegistrations = new List<ProviderRegistration>();
private readonly object _sync = new object();
Expand Down Expand Up @@ -212,7 +210,7 @@ private LoggerInformation[] CreateLoggers(string categoryName)

foreach (LoggerInformation loggerInformation in loggers)
{
RuleSelector.Select(_filterOptions,
LoggerRuleSelector.Select(_filterOptions,
loggerInformation.ProviderType,
loggerInformation.Category,
out LogLevel? minLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace Microsoft.Extensions.Logging
{
internal class LoggerRuleSelector
internal static class LoggerRuleSelector
{
public void Select(LoggerFilterOptions options, Type providerType, string category, out LogLevel? minLevel, out Func<string, string, LogLevel, bool> filter)
public static void Select(LoggerFilterOptions options, Type providerType, string category, out LogLevel? minLevel, out Func<string, string, LogLevel, bool> filter)
{
filter = null;
minLevel = options.MinLevel;
Expand Down

0 comments on commit e6cc4ae

Please sign in to comment.