本文整理汇总了PHP中Zend_Log::getTimestampFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log::getTimestampFormat方法的具体用法?PHP Zend_Log::getTimestampFormat怎么用?PHP Zend_Log::getTimestampFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::getTimestampFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _writeRepeated
/**
* Write how often last message is repeated
*
* @throws Zend_Log_Exception
*/
protected function _writeRepeated()
{
if ($this->_lastMessageCount < 2) {
// Do nothing
return;
}
$log = new Zend_Log();
$event = array('timestamp' => date($log->getTimestampFormat()), 'priorityName' => 'DEBUG', 'priority' => Zend_Log::DEBUG, 'message' => sprintf("Last message repeated %s times", $this->_lastMessageCount));
$line = $this->_formatter->format($event);
if (false === @fwrite($this->_stream, $line)) {
#require_once 'Zend/Log/Exception.php';
throw new Zend_Log_Exception("Unable to write to stream");
}
}
示例2: testSetAndGetTimestampFormat
/**
* @group ZF-9870
*/
public function testSetAndGetTimestampFormat()
{
$logger = new Zend_Log($this->writer);
$this->assertEquals('c', $logger->getTimestampFormat());
$this->assertSame($logger, $logger->setTimestampFormat('Y-m-d H:i:s'));
$this->assertEquals('Y-m-d H:i:s', $logger->getTimestampFormat());
}