public void Dispose()
 {
     _delegate.Dispose();
     _delegate = null;
     _settings = null;
     _loggers  = null;
     _self     = null;
 }
Exemplo 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));
        }
        internal static ILoggerProvider CreateSingleton(Func <string, LogLevel, bool> filter, bool includeScopes)
        {
            if (_self != null)
            {
                throw new InvalidOperationException("CloudFoundryLoggerProvider already created");
            }

            return(_self = new CloudFoundryLoggerProvider(filter, includeScopes));
        }
Exemplo n.º 5
0
 public static ILoggerFactory AddCloudFoundry(
     this ILoggerFactory factory,
     Func <string, LogLevel, bool> filter,
     bool includeScopes)
 {
     // factory.AddProvider(new CloudFoundryLoggerProvider(filter, includeScopes));
     factory.AddProvider(CloudFoundryLoggerProvider.CreateSingleton(filter, includeScopes));
     return(factory);
 }