/// <summary>
 /// Initializes a new instance of the <see cref="EntLibLoggerFactoryAdapter"/> class
 /// with the specified configuration parameters.
 /// </summary>
 /// <param name="defaultPriority">defaults to <see cref="EntLibLoggerSettings.DEFAULTPRIORITY"/></param>
 /// <param name="exceptionFormat">defaults to <see cref="EntLibLoggerSettings.DEFAULTEXCEPTIONFORMAT"/></param>
 /// <param name="logWriter">a <see cref="LogWriter"/> instance to use</param>
 public EntLibLoggerFactoryAdapter(int defaultPriority, string exceptionFormat, LogWriter logWriter)
     : base(true)
 {
     if (exceptionFormat.Length == 0)
     {
         exceptionFormat = null;
     }
     _settings  = new EntLibLoggerSettings(defaultPriority, exceptionFormat);
     _logWriter = logWriter;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EntLibLogger"/> class.
        /// </summary>
        /// <param name="category">The category.</param>
        /// <param name="logWriter">the <see cref="LogWriter"/> to write log events to.</param>
        /// <param name="settings">the logger settings</param>
        public EntLibLogger(string category, LogWriter logWriter, EntLibLoggerSettings settings)
        {
            this.category = category;
            this.logWriter = logWriter;
            this.settings = settings;

            VerboseLogEntry = new TraceLevelLogEntry(category, TraceEventType.Verbose);
            InformationLogEntry = new TraceLevelLogEntry(category, TraceEventType.Information);
            WarningLogEntry = new TraceLevelLogEntry(category, TraceEventType.Warning);
            ErrorLogEntry = new TraceLevelLogEntry(category, TraceEventType.Error);
            CriticalLogEntry = new TraceLevelLogEntry(category, TraceEventType.Critical);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EntLibLogger"/> class.
        /// </summary>
        /// <param name="category">The category.</param>
        /// <param name="logWriter">the <see cref="LogWriter"/> to write log events to.</param>
        /// <param name="settings">the logger settings</param>
        public EntLibLogger(string category, LogWriter logWriter, EntLibLoggerSettings settings)
        {
            this.category = category;
            this.logWriter = logWriter;
            this.settings = settings;

            VerboseLogEntry = new TraceLevelLogEntry(category, TraceEventType.Verbose);
            InformationLogEntry = new TraceLevelLogEntry(category, TraceEventType.Information);
            WarningLogEntry = new TraceLevelLogEntry(category, TraceEventType.Warning);
            ErrorLogEntry = new TraceLevelLogEntry(category, TraceEventType.Error);
            CriticalLogEntry = new TraceLevelLogEntry(category, TraceEventType.Critical);
        }
 /// <summary>
 /// Creates a new <see cref="EntLibLogger"/> instance.
 /// </summary>
 protected virtual ILog CreateLogger(string name, LogWriter logWriter, EntLibLoggerSettings settings)
 {
     return(new EntLibLogger(name, LogWriter, _settings));
 }
 public TestEntLibLogger(TestEntLibLoggerFactoryAdapter owner, string category, LogWriter logWriter, EntLibLoggerSettings settings)
     : base(category, logWriter, settings)
 {
     this.owner = owner;
 }
 protected override ILog CreateLogger(string name, LogWriter logWriter, EntLibLoggerSettings settings)
 {
     return new TestEntLibLogger(this, name, logWriter, settings);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntLibLoggerFactoryAdapter"/> class
 /// with the specified configuration parameters.
 /// </summary>
 /// <param name="defaultPriority">defaults to <see cref="EntLibLoggerSettings.DEFAULTPRIORITY"/></param>
 /// <param name="exceptionFormat">defaults to <see cref="EntLibLoggerSettings.DEFAULTEXCEPTIONFORMAT"/></param>
 /// <param name="logWriter">a <see cref="LogWriter"/> instance to use</param>
 public EntLibLoggerFactoryAdapter(int defaultPriority, string exceptionFormat, LogWriter logWriter)
     : base(true)
 {
     if (exceptionFormat.Length == 0)
     {
         exceptionFormat = null;
     }
     _settings = new EntLibLoggerSettings(defaultPriority, exceptionFormat);
     _logWriter = logWriter;
 }
 /// <summary>
 /// Creates a new <see cref="EntLibLogger"/> instance.
 /// </summary>
 protected virtual ILog CreateLogger(string name, LogWriter logWriter, EntLibLoggerSettings settings)
 {
     return new EntLibLogger(name, LogWriter, _settings);
 }
 public TestEntLibLogger(TestEntLibLoggerFactoryAdapter owner, string category, LogWriter logWriter, EntLibLoggerSettings settings)
     : base(category, logWriter, settings)
 {
     this.owner = owner;
 }
 protected override ILog CreateLogger(string name, LogWriter logWriter, EntLibLoggerSettings settings)
 {
     return(new TestEntLibLogger(this, name, logWriter, settings));
 }