public void WriteToNamed() { var myloggy = Loggy.Get("named"); myloggy.Info("test"); appender.MustCatch(LogLevel.Info, "test", "named"); }
public void Setup() { Loggy.Manager = null; Loggy.Manager = new LoggyManager(); this.appender = new TestAppender { Level = LogLevel.Info }; Loggy.Get().Appenders.Add(appender); Loggy.Level = LogLevel.Trace; }
public void ValidConfig() { var def = Loggy.Get(); Assert.NotNull(def); Assert.True(def.Isolated); Assert.AreEqual(1, def.Appenders.Count); Assert.AreEqual(appender, def.Appenders[0]); Assert.AreEqual("default", def.Name); }
public void CanResetLogger() { var logger = Loggy.Get("named"); Assert.False(logger.Isolated); Loggy.Manager.Loggers["named"] = new DefaultLoggy { Name = "xxxx" }; var logger2 = Loggy.Get("named"); Assert.AreEqual("xxxx", logger2.Name); }
public void WriteToSpecial() { var myappender = new TestAppender { Level = LogLevel.Debug }; Loggy.Get("named", s => { s.Isolated = true; s.Level = LogLevel.Info; s.Appenders.Add(myappender); }); Loggy.Get("named").Info("test"); appender.MustNotCatch(LogLevel.Info, "test", "named"); myappender.MustCatch(LogLevel.Info, "test", "named"); }
private void CreateLogger() { if (LoggerHost != "" && LoggerPort != 0 && LoggerName != "") { Console.WriteLine("LOGLEVEL " + LogLevel); var def = Loggy.Get(); def.Level = LogLevel; def.Appenders.Add(new UdpAppender(LoggerHost, LoggerPort) { AutoFlushSize = 1, Format = LoggerFormat }); def.Debug("debug test тест"); def.Trace("trace test тест"); def.Info("info test тест"); def.Warn("warning test тест"); def.Error("error test тест", new Exception("Test exception")); def.Fatal("fatal test тест"); } }
public TrustedOrigin() { this.logg = Loggy.Get("sys.sec.trusted"); }