本文整理匯總了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());
}