Exemple #1
0
 public void Config(ILogConfig cfg)
 {
     if (cfg != null)
     {
         this._layout = cfg.Layout;
         this._writer = cfg.Writer;
         this._level = cfg.GetLogLevel(this._name);
     }
     else
     {
         this._layout = NullLayout.Instance;
         this._writer = NullWriter.Instance;
         this._level = LogLevel.None;
     }
 }
Exemple #2
0
 public void Config(ILogConfig cfg)
 {
     if (cfg != null)
     {
         this._layout = cfg.Layout;
         this._writer = cfg.Writer;
         this._level  = cfg.GetLogLevel(this._name);
     }
     else
     {
         this._layout = NullLayout.Instance;
         this._writer = NullWriter.Instance;
         this._level  = LogLevel.None;
     }
 }
Exemple #3
0
 public void TestDeclare()
 {
     Assert.AreEqual(LogLevel.Debug, _cfg.GetLogLevel("abc"));
     Assert.AreEqual(LogLevel.Warning, _cfg.GetLogLevel("abc.def"));
     Assert.AreEqual(LogLevel.Info, _cfg.GetLogLevel("def"));
 }