public void CombineLevelTests() { Assert.That(LogFilter.Combine(LogLevelFilter.Error, LogLevelFilter.Fatal), Is.EqualTo(LogLevelFilter.Error)); Assert.That(LogFilter.Combine(LogLevelFilter.None, LogLevelFilter.Fatal), Is.EqualTo(LogLevelFilter.Fatal)); Assert.That(LogFilter.Combine(LogLevelFilter.Error, LogLevelFilter.None), Is.EqualTo(LogLevelFilter.Error)); Assert.That(LogFilter.Combine(LogLevelFilter.None, LogLevelFilter.None), Is.EqualTo(LogLevelFilter.None)); Assert.That(LogFilter.Combine(LogLevelFilter.Info, LogLevelFilter.Error), Is.EqualTo(LogLevelFilter.Info)); }
public void CombineLogTests() { LogFilter f = new LogFilter(LogLevelFilter.None, LogLevelFilter.Error); LogFilter f2 = f.SetGroup(LogLevelFilter.Info); Assert.That(f2.Line == LogLevelFilter.Error && f2.Group == LogLevelFilter.Info); LogFilter f3 = new LogFilter(LogLevelFilter.Trace, LogLevelFilter.Info); LogFilter f4 = f2.Combine(f3); Assert.That(f4.Equals(f3)); Assert.That(f4 == f3); }
/// <summary> /// Enables any handler to publish the minimal filter level it requires (if any). /// </summary> /// <param name="filter">Filter required by a <see cref="HandlerBase"/>.</param> public void SetMinimalFilter(LogFilter filter) { _currentFilter = _currentFilter.Combine(filter); }