예제 #1
0
        private LoggerInformation[] CreateLoggers(string category)
        {
            var list = new LoggerInformation[_providers.Count];

            for (int i = 0; i < _providers.Count; i++)
            {
                list[i] = new LoggerInformation(_providers[i], category);
            }

            return(list);
        }
예제 #2
0
        public void AddProvider(ILoggerProvider provider)
        {
            lock (_sync)
            {
                _providers.Add(provider);

                foreach (var existLogger in _loggers)
                {
                    var logger            = existLogger.Value;
                    var loggerInformation = logger.Loggers;

                    var newLoggerIndex = loggerInformation.Length;
                    Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
                    loggerInformation[newLoggerIndex] = new LoggerInformation(provider, existLogger.Key);

                    logger.MessageLoggers = CreateMessageLogger(loggerInformation);
                }
            }
        }