Beispiel #1
0
        public void Log_Should_LogByLevel()
        {
            var simpleLog = SimpleLogFactory.Resolve().Create("Foo");

            simpleLog.EnabledLevel = SimpleLogLevel.Information;

            simpleLog.ShouldLog(SimpleLogLevel.Trace).ShouldFalse();
            simpleLog.ShouldLog(SimpleLogLevel.Debug).ShouldFalse();

            simpleLog.ShouldLog(SimpleLogLevel.Information).ShouldTrue();
            simpleLog.ShouldLog(SimpleLogLevel.Warning).ShouldTrue();
            simpleLog.ShouldLog(SimpleLogLevel.Error).ShouldTrue();
            simpleLog.ShouldLog(SimpleLogLevel.Critical).ShouldTrue();
        }
Beispiel #2
0
        private ISimpleLog GetLogger(string category = null)
        {
            var logger = SimpleLogFactory.Resolve().GetOrCreate(category);

            return(logger);
        }