示例#1
0
        public static void UseLogger(LogWriterFactory logger)
        {
            lock (_locker)
            {
                if (_logger != null)
                {
                    _logger.Shutdown();
                }
                _logger = null;

                _logger = logger;
            }
        }
示例#2
0
        public static void UseLogger(HostLoggerConfigurator configurator)
        {
            lock (_locker)
            {
                _configurator = configurator;

                LogWriterFactory logger = _configurator.CreateLogWriterFactory();

                if (_logWriterFactory != null)
                {
                    _logWriterFactory.Shutdown();
                }
                _logWriterFactory = null;

                _logWriterFactory = logger;
            }
        }