Пример #1
0
 public static LoggingCollectionSettings ToCaseInsensitive([CanBeNull] this LoggingCollectionSettings settings)
 => settings == null
         ? null
         : new LoggingCollectionSettings(settings.Enabled)
 {
     Whitelist = settings.Whitelist == null ? null : new HashSet <string>(settings.Whitelist, StringComparer.OrdinalIgnoreCase),
     Blacklist = settings.Blacklist == null ? null : new HashSet <string>(settings.Blacklist, StringComparer.OrdinalIgnoreCase)
 };
Пример #2
0
        public static bool IsEnabledForKey([NotNull] this LoggingCollectionSettings settings, [NotNull] string key)
        {
            if (settings.Whitelist == null)
            {
                return(settings.Blacklist == null || !settings.Blacklist.Contains(key));
            }

            return(settings.Whitelist.Contains(key));
        }
Пример #3
0
 public static bool IsEnabledForAllKeys([NotNull] this LoggingCollectionSettings settings) =>
 settings.Whitelist == null && settings.Blacklist == null;
Пример #4
0
 public static bool IsEnabledForRequest([NotNull] this LoggingCollectionSettings settings, [NotNull] HttpRequest request) =>
 settings.Enabled(request);