/// <inheritdoc />
        public ILogger CreateLogger(string categoryName)
        {
            var newLogger = _loggers = new EventSourceLogger(categoryName, _factoryID, _eventSource, _loggers);

            newLogger.Level = GetLoggerLevel(newLogger.CategoryName);
            return(newLogger);
        }
 /// <inheritdoc />
 public void Dispose()
 {
     // Turn off any logging
     for (EventSourceLogger logger = _loggers; logger != null; logger = logger.Next)
     {
         logger.Level = LogLevel.None;
     }
 }
        /// <inheritdoc />
        public ILogger CreateLogger(string categoryName)
        {
            // need to check if the filter spec and internal event source level has changed
            // and update the _defaultLevel if it has
            _eventSource.ApplyFilterSpec();
            var newLogger = _loggers = new EventSourceLogger(categoryName, _factoryID, _eventSource, _loggers);

            newLogger.Level = ParseLevelSpecs(_filterSpec, _defaultLevel, newLogger.CategoryName);
            return(newLogger);
        }
Esempio n. 4
0
        public EventSourceLogger(string categoryName, int factoryID, LoggingEventSource eventSource, EventSourceLogger next)
        {
            CategoryName = categoryName;

            // Default is to turn on all the logging
            Level = LogLevel.Trace;

            _factoryID   = factoryID;
            _eventSource = eventSource;
            Next         = next;
        }
        public EventSourceLogger(string categoryName, int factoryID, LoggingEventSource eventSource, EventSourceLogger next)
        {
            CategoryName = categoryName;

            // Default is to turn off logging
            Level = LoggingEventSource.LoggingDisabled;

            _factoryID   = factoryID;
            _eventSource = eventSource;
            Next         = next;
        }
Esempio n. 6
0
 /// <inheritdoc />
 public ILogger CreateLogger(string categoryName)
 {
     return(_loggers = new EventSourceLogger(categoryName, _factoryID, _eventSource, _loggers));
 }