示例#1
0
文件: LogTest.php 项目: hjr3/zf2
 /**
  * @group ZF-8602
  */
 public function testNumericLogStreamFilterParamsPriorityDoesNotFail()
 {
     $options = array('stream' => array('writerName' => 'Stream', 'writerParams' => array('stream' => "php://memory", 'mode' => 'a'), 'filterName' => 'Priority', 'filterParams' => array('priority' => '4')));
     $resource = new Zend_Application_Resource_Log($options);
     $resource->setBootstrap($this->bootstrap);
     $resource->init();
 }
示例#2
0
 /**
  * @group ZF-9790
  */
 public function testInitializationWithFilterAndFormatter()
 {
     $stream = fopen('php://memory', 'w+');
     $options = array('memory' => array('writerName' => 'Stream', 'writerParams' => array('stream' => $stream), 'filterName' => 'Priority', 'filterParams' => array('priority' => Zend_Log::INFO), 'formatterName' => 'Simple', 'formatterParams' => array('format' => '%timestamp%: %message%')));
     $message = 'tottakai';
     $resource = new Zend_Application_Resource_Log($options);
     $resource->setBootstrap($this->bootstrap);
     $log = $resource->init();
     $this->assertType('Zend_Log', $log);
     $log->log($message, Zend_Log::INFO);
     rewind($stream);
     $contents = stream_get_contents($stream);
     $this->assertStringEndsWith($message, $contents);
     $this->assertRegexp('/\\d\\d:\\d\\d:\\d\\d/', $contents);
 }
示例#3
0
文件: Log.php 项目: luismayta/zrt
 public function init()
 {
     parent::init();
 }