public static ILoggerFactory AddFluentd(
     this ILoggerFactory factory,
     ILoggerSwitches swithes,
     FluentdOptions options)
 {
     if (factory == null)
     {
         throw new ArgumentNullException(nameof(factory));
     }
     factory.AddProvider(new FluentdLoggerProvider(swithes, options));
     return(factory);
 }
        private Func <string, LogLevel, bool> GetFilter(string name, ILoggerSwitches switches)
        {
            if (_filter != null)
            {
                return(_filter);
            }

            if (switches != null)
            {
                foreach (var prefix in GetKeyPrefixes(name))
                {
                    LogLevel level;
                    if (switches.TryGetSwitch(prefix, out level))
                    {
                        return((n, l) => l >= level);
                    }
                }
            }

            return((n, l) => false);
        }
 public FluentdLoggerProvider(ILoggerSwitches switches, FluentdOptions options)
 {
     _switches  = switches;
     _options   = options;
     _logClient = new FluentdClient(options);
 }