public static ILoggingBuilder AddSubscription(this ILoggingBuilder builder, IObserver <SubscriberLogEntry> subscriber)
        {
            SubscriptionLogProvider prov = new SubscriptionLogProvider();

            prov.Subscribe(subscriber);
            return(builder.AddProvider(prov));
        }
        public static ILoggerFactory AddSubscription(this ILoggerFactory factory, IObserver <SubscriberLogEntry> subscriber)
        {
            SubscriptionLogProvider prov = new SubscriptionLogProvider();

            prov.Subscribe(subscriber);
            factory.AddProvider(prov);
            return(factory);
        }
예제 #3
0
        static RaciLog()
        {
            _enabled     = false;
            _syncRoot    = new object();
            MinLevel     = LogLevel.Debug;
            LogPublisher = new SubscriptionLogProvider();
            NullLogger   = new LoggerFactory().AddNull().CreateLogger("Null");
            _factory     = new LoggerFactory();
            _factory.AddConsole(EntryFilter, true);
            _factory.AddProvider(LogPublisher);
#if DEBUG
            _factory.AddDebug(LogLevel.Debug);
#endif
#if TRACE
            //_factory.AddTraceSource()
#endif
            Enabled       = true;
            DefaultLogger = _factory.CreateLogger("RACI");
        }
 public static ILoggerFactory AddSubscription(this ILoggerFactory factory, SubscriptionLogProvider provider)
 {
     factory.AddProvider(provider);
     return(factory);
 }
 public static ILoggingBuilder AddSubscription(this ILoggingBuilder builder, SubscriptionLogProvider provider)
 {
     return(builder.AddProvider(provider));
 }
 public SubscriberLog(SubscriptionLogProvider prov, LogLevel minLevel)
     : this(prov)
 {
     MinLevel = minLevel;
 }
 public SubscriberLog(SubscriptionLogProvider prov)
     : this()
 {
     Subscribers = new List <IObserver <SubscriberLogEntry> >();
 }