Inheritance: LoggerFactoryBase
コード例 #1
0
    public void CanCreateLoggerFromCurrentClassWithLoggerFactory()
    {
      var loggerFactory = new NLogLoggerFactory();

      var logger = loggerFactory.GetCurrentInstanceLogger();

      Assert.NotNull(logger);
      Assert.AreEqual(GetType().FullName, logger.Name);
    }
コード例 #2
0
    public void CanCreateLoggerFromTypeWithLoggerFactory()
    {
      var loggerFactory = new NLogLoggerFactory();

      var logger = loggerFactory.GetLogger(GetType());

      Assert.NotNull(logger);
      Assert.AreEqual(GetType().FullName, logger.Name);
    }
コード例 #3
0
    public void CanCreateLoggerFromNameWithLoggerFactory()
    {
      var loggerFactory = new NLogLoggerFactory();

      var logger = loggerFactory.GetLogger("logger name");

      Assert.NotNull(logger);
      Assert.AreEqual("logger name", logger.Name);
    }
コード例 #4
0
ファイル: GlobalTest.cs プロジェクト: ChrisMH/Buddy.Database
    public void SetUp()
    {
      try
      {
        Logger = new NLogLoggerFactory().GetCurrentInstanceLogger();
   
        DbManager1 = new RavenDbManager
                     {
                       Description = new DbDescription {ConnectionInfo = new DbConnectionInfo {ConnectionStringName = "Test1"}}
                     };

        DbManager2 = new RavenDbManager
                     {
                       Description = new DbDescription {ConnectionInfo = new DbConnectionInfo {ConnectionStringName = "Test1"}}
                     };
      }
      catch (Exception e)
      {
        if (Logger != null) Logger.Fatal(e, "SetUp : {0} : {1}", e.GetType(), e.Message);
        throw;
      }
    }