public void Dispose()
 {
     _delegate.Dispose();
     _delegate = null;
     _settings = null;
     _loggers  = null;
     _self     = null;
 }
Esempio n. 2
0
 public static ILoggerFactory AddCloudFoundry(
     this ILoggerFactory factory,
     ICloudFoundryLoggerSettings settings)
 {
     //factory.AddProvider(new CloudFoundryLoggerProvider(settings));
     factory.AddProvider(CloudFoundryLoggerProvider.CreateSingleton(settings));
     return(factory);
 }
        internal static ILoggerProvider CreateSingleton(ICloudFoundryLoggerSettings settings)
        {
            if (_self != null)
            {
                throw new InvalidOperationException("CloudFoundryLoggerProvider already created");
            }

            return(_self = new CloudFoundryLoggerProvider(settings));
        }
 public CloudFoundryLoggerProvider(ICloudFoundryLoggerSettings settings)
 {
     _delegate = new ConsoleLoggerProvider(settings);
     _settings = settings;
 }
 public CloudFoundryLoggerProvider(Func <string, LogLevel, bool> filter, bool includeScopes)
 {
     _delegate = new ConsoleLoggerProvider(filter, includeScopes);
     _filter   = true;
     _settings = null;
 }