當前位置: 首頁>>代碼示例>>C#>>正文


C# Logger.log方法代碼示例

本文整理匯總了C#中System.Logger.log方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.log方法的具體用法?C# Logger.log怎麽用?C# Logger.log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Logger的用法示例。


在下文中一共展示了Logger.log方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: testEventTiming

 // throws InterruptedException
 public virtual void testEventTiming()
 {
     Logger l = new Logger();
     l.log(new Event(null,null));
     Thread.Sleep(100);
     l.log(new Event(null,null));
     Assertion.AssertTrue(l.getElapsedTime() >= 0);
 }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:9,代碼來源:LoggerTest.cs

示例2: testTopDownUntil

        // throws VisitFailure
        public virtual void testTopDownUntil()
        {
            IVisitor stopAt = new SucceedAtNodes(n1, n2);

            Logger expected = new Logger();
            expected.log(new Event(stopAt, n0));
            expected.log(new Event(stopAt, n1));
            expected.log(new Event(stopAt, n2));

            IVisitable nodeReturned =
                DoWhileSuccess.TopDownUntil(logVisitor(stopAt)).visit(n0);

            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n0, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:16,代碼來源:DoWhileSuccessTest.cs

示例3: testSucceedAtSomeNode

 // throws VisitFailure
 public virtual void testSucceedAtSomeNode()
 {
     IVisitor v = new FailAtNodes(n1,n2);
     (logVisitor(v)).visit(n0);
     Logger expected = new Logger();
     expected.log(new Event(v,n0));
     Assertion.AssertEquals(expected,logger);
 }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:9,代碼來源:FailAtNodesTest.cs

示例4: testTrue

        // throws VisitFailure
        public virtual void testTrue()
        {
            Logger expected = new Logger();
            expected.log( new Event( idTrue, n0 ) );

            IVisitable nodeReturned = new IfThenElse( new Identity(), logVisitor(idTrue), logVisitor(idFalse)).visit(n0);

            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n0, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:11,代碼來源:IfThenElseTest.cs

示例5: testFailAtSomeNodes

 // throws VisitFailure
 public virtual void testFailAtSomeNodes()
 {
     ArrayList nodes = new ArrayList();
     nodes.Add(n0);
     nodes.Add(n1);
     nodes.Add(n11);
     IVisitor v = new FailAtNodes(nodes);
     new Not((logVisitor(v))).visit(n0);
     new Not((logVisitor(v))).visit(n1);
     (logVisitor(v)).visit(n2);
     new Not((logVisitor(v))).visit(n11);
     (logVisitor(v)).visit(n12);
     Logger expected = new Logger();
     expected.log(new Event(v,n0));
     expected.log(new Event(v,n1));
     expected.log(new Event(v,n2));
     expected.log(new Event(v,n11));
     expected.log(new Event(v,n12));
     Assertion.AssertEquals(expected,logger);
 }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:21,代碼來源:FailAtNodesTest.cs

示例6: testDoWhileSuccess

        // throws VisitFailure
        public virtual void testDoWhileSuccess()
        {
            IVisitor condition = new FailAtNodes(n1, n2);
            IVisitor action = new Identity();

            Logger expected = new Logger();
            expected.log(new Event(condition, n0));
            expected.log(new Event(action, n0));
            expected.log(new Event(condition, n1));
            expected.log(new Event(condition, n2));

            IVisitable nodeReturned =
                new DoWhileSuccess(
                logVisitor(condition),
                logVisitor(action)).visit(
                n0);

            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n0, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:21,代碼來源:DoWhileSuccessTest.cs

示例7: testTopDownUntilAtBorder

        // throws VisitFailure
        public virtual void testTopDownUntilAtBorder()
        {
            IVisitor stopAt = new SucceedAtNodes(n1, n2);

            Logger expected = new Logger();

            IVisitor borderAction = new Identity();

            expected.log(new Event(stopAt, n0));
            expected.log(new Event(stopAt, n1));
            expected.log(new Event(borderAction, n1));
            expected.log(new Event(stopAt, n2));
            expected.log(new Event(borderAction, n2));

            IVisitable nodeReturned =
                new TopDownUntil(logVisitor(stopAt),
                logVisitor(borderAction)
                ).visit(n0);

            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n0, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:23,代碼來源:DoWhileSuccessTest.cs

示例8: testFailAtSomeNode

 // throws VisitFailure
 public virtual void testFailAtSomeNode()
 {
     IVisitor v = new FailAtNodes(n0,n1);
     try
     {
         (logVisitor(v)).visit(n0);
         Assertion.Fail("VisitFailure should have occured");
     }
     catch (VisitFailure)
     {
         Logger expected = new Logger();
         expected.log(new Event(v,n0));
         Assertion.AssertEquals(expected,logger);
     }
 }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:16,代碼來源:FailAtNodesTest.cs

示例9: testTrueFailingThen

        // throws VisitFailure
        public virtual void testTrueFailingThen()
        {
            Fail failingThen = new Fail();
            Logger expected = new Logger();
            expected.log( new Event( failingThen, n0 ) );

            try
            {
                nodeReturned = new IfThenElse( new Identity(), logVisitor(failingThen),	logVisitor(idFalse)).visit(n0);
                Assertion.Fail();
            }
            catch(VisitFailure)
            {
                Assertion.AssertEquals("trace", expected, logger);
                Assertion.AssertNull("returned node", nodeReturned);
            }
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:18,代碼來源:IfThenElseTest.cs

示例10: testStopDownUp

        // throws jjtraveler.VisitFailure
        public virtual void testStopDownUp()
        {
            Identity downId = new Identity();
            Identity upId = new Identity();
            Identity stopId = new Identity();

            Logger expected = new Logger();
            expected.log( new Event(downId, n4) );
            expected.log( new Event(stopId, n4) );
            expected.log( new Event(upId, n4) );

            IVisitor  visitor = new DownUp(
                logVisitor(downId), logVisitor(stopId), logVisitor(upId) );

            IVisitable nodeReturned = visitor.visit(n4);
            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n4, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:19,代碼來源:LibraryTest.cs

示例11: testSequence

        // throws VisitFailure
        public virtual void testSequence()
        {
            Identity id1 = new Identity();
            Identity id2 = new Identity();

            Logger expected = new Logger();
            expected.log( new Event(id1, n0) );
            expected.log( new Event(id2, n0) );

            Sequence  ls = new Sequence( logVisitor(id1), logVisitor(id2) );

            IVisitable nodeReturned = ls.visit(n0);

            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(nodeReturned, n0);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:17,代碼來源:LibraryTest.cs

示例12: testNonStopDownUp

        // throws jjtraveler.VisitFailure
        public virtual void testNonStopDownUp()
        {
            Identity downId = new Identity();
            Identity upId = new Identity();
            Fail stop = new Fail();

            Logger expected = new Logger();
            expected.log( new Event(downId, n3) );
            expected.log( new Event(downId, n0) );
            expected.log( new Event(upId, n0) );
            expected.log( new Event(downId, n1) );
            expected.log( new Event(upId, n1) );
            expected.log( new Event(upId, n3) );

            IVisitor  visitor = new DownUp(
                logVisitor(downId), stop, logVisitor(upId) );

            IVisitable nodeReturned = visitor.visit(n3);
            Assertion.AssertEquals(expected, logger);
            Assertion.AssertEquals(n3, nodeReturned);
        }
開發者ID:cwi-swat,項目名稱:jjtraveler-csharp,代碼行數:22,代碼來源:LibraryTest.cs


注:本文中的System.Logger.log方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。