Exemplo n.º 1
0
        //1
        public static BackgroundLogger BackgroundCompositeLogger(
            this LoggingWizardCharms charms,
            ILogRecordVerifier recordVerifier,
            bool leaveOpen,
            params ILogger[] loggers
            )
        {
            var baseLogger = new CompositeLogger(loggers, leaveOpen)
            {
                RecordVerifier = recordVerifier
            };

            return(charms.BackgroundLogger(baseLogger));
        }
Exemplo n.º 2
0
        public ILogger Load(JToken loggingSection)
        {
            var loggerCollectionSection = loggingSection.Children()
                                          .ToList();

            if (loggerCollectionSection.Count == 1)
            {
                var info = loggerCollectionSection.First();

                var logger = CreateLoggerFromJson(info);

                return(logger);
            }
            else
            {
                var loggers = loggerCollectionSection.Select(x => CreateLoggerFromJson(x))
                              .ToArray();

                var compositeLogger = new CompositeLogger(loggers);

                return(compositeLogger);
            }
        }