本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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'))));
}
示例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);
}
示例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);
}
示例7: testFactoryShouldKeepDefaultTimestampFormat
/**
* @group ZF-10990
*/
public function testFactoryShouldKeepDefaultTimestampFormat()
{
$config = array(
'timestampFormat' => '',
'mock' => array(
'writerName' => 'Mock'
)
);
$logger = Logger::factory($config);
$this->assertEquals('c', $logger->getTimestampFormat());
}