当前位置: 首页>>代码示例>>PHP>>正文


PHP Logger::factory方法代码示例

本文整理汇总了PHP中Zend\Log\Logger::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::factory方法的具体用法?PHP Logger::factory怎么用?PHP Logger::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Log\Logger的用法示例。


在下文中一共展示了Logger::factory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testFactory

    public function testFactory()
    {
        $cfg = array('log' => array('memory' => array(
            'writerName' => "Mock"
        )));

        $logger = Logger::factory($cfg['log']);
        $this->assertTrue($logger instanceof Logger);
    }
开发者ID:niallmccrudden,项目名称:zf2,代码行数:9,代码来源:MockTest.php

示例2: testFactory

 public function testFactory()
 {
     $cfg = array('log' => array('memory' => array('writerName' => "Db", 'writerParams' => array('db' => $this->db, 'table' => $this->tableName))));
     $logger = Logger::factory($cfg['log']);
     $this->assertTrue($logger instanceof Logger);
 }
开发者ID:rexmac,项目名称:zf2,代码行数:6,代码来源:DbTest.php

示例3: testFactoryUrl

 public function testFactoryUrl()
 {
     $cfg = array('log' => array('memory' => array('writerName' => "Mock", 'writerParams' => array('url' => 'http://localhost', 'mode' => 'a'))));
     $logger = Logger::factory($cfg['log']);
     $this->assertTrue($logger instanceof Logger);
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:6,代码来源:StreamTest.php

示例4: testFactoryRaisesExceptionWithInvalidPriority

 public function testFactoryRaisesExceptionWithInvalidPriority()
 {
     $this->setExpectedException('Zend\\Log\\Exception\\InvalidArgumentException', 'must be an integer');
     $logger = Logger::factory(array('Null' => array('writerName' => 'Mock', 'filterName' => 'Priority', 'filterParams' => array('priority' => 'somestring'))));
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:5,代码来源:PriorityTest.php

示例5: testFactory

 public function testFactory()
 {
     $cfg = array('log' => array('memory' => array('writerName' => "Mock", 'filterName' => "Message", 'filterParams' => array('regexp' => "/42/"))));
     $logger = Logger::factory($cfg['log']);
     $this->assertTrue($logger instanceof Logger);
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:6,代码来源:MessageTest.php

示例6: testFactoryUsesNameAndNamespaceWithoutModifications

 public function testFactoryUsesNameAndNamespaceWithoutModifications()
 {
     $cfg = array('log' => array('memory' => array('writerName' => "ZendMonitor", 'writerNamespace' => "Zend\\Log\\Writer")));
     $logger = Logger::factory($cfg['log']);
     $this->assertTrue($logger instanceof Logger);
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:6,代码来源:LoggerTest.php

示例7: testFactoryShouldKeepDefaultTimestampFormat

    /**
     * @group ZF-10990
     */
    public function testFactoryShouldKeepDefaultTimestampFormat()
    {
        $config = array(
            'timestampFormat' => '',
            'mock' => array(
                'writerName' => 'Mock'
            )
        );
        $logger = Logger::factory($config);

        $this->assertEquals('c', $logger->getTimestampFormat());
    }
开发者ID:niallmccrudden,项目名称:zf2,代码行数:15,代码来源:LoggerTest.php


注:本文中的Zend\Log\Logger::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。