Exemple #1
0
        public RoutingWriter(RoutingWrapperConfiguration config,
                             Dictionary <string, List <ILoggingEventWriter> > routingWriters,
                             IEnumerable <ILoggingEventWriter> others, IEnumerable <ILoggingEventWriter> all)
        {
            Contract.Requires(config != null);
            Contract.Requires(routingWriters != null);

            _routingLoggers = routingWriters.ToDictionary(o => o.Key, o => new List <ILoggingEventWriter>(o.Value));

            if (others != null)
            {
                _others = new List <ILoggingEventWriter>(others);
            }
            else
            {
                _others = new List <ILoggingEventWriter>();
            }

            if (all != null)
            {
                _all = new List <ILoggingEventWriter>(all);
            }
            else
            {
                _all = new List <ILoggingEventWriter>();
            }
        }
Exemple #2
0
        public RoutingWriter(RoutingWrapperConfiguration config)
        {
            Contract.Requires(config != null);

            _routingLoggers = config.RoutingWriters.ToDictionary(pair => pair.Key, pair => pair.Value.Select(LoggerFactory.CreateWriter).ToList());
            _all            = config.FromAll.Select(LoggerFactory.CreateWriter).ToList();
            _others         = config.FromOthers.Select(LoggerFactory.CreateWriter).ToList();
        }