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; } }
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")); }