Exemplo n.º 1
0
 public function testExtraAdditionalInfo()
 {
     $message = 'test message';
     $extra = 'extra additional information for the logger';
     $this->logger->addCustomExtra(array('defaultInfo1' => 'additional info, sould not overwrite anything previous'));
     $this->assertInstanceOf('EddieJaoude\\Zf2Logger\\Log\\Logger', $this->logger->log(Logger::DEBUG, $message, array($extra)));
     $this->assertEquals(7, $this->logger->getWriters()->current()->events[0]['priority']);
     $this->assertEquals('DEBUG', $this->logger->getWriters()->current()->events[0]['priorityName']);
     $this->assertEquals($message, $this->logger->getWriters()->current()->events[0]['message']);
     $this->assertEquals(array('Zf2Logger' => array('sessionId' => '', 'host' => 'CLI', 'ip' => 'unavailable'), $extra, array('defaultInfo1' => 'additional info, sould not overwrite anything previous')), $this->logger->getWriters()->current()->events[0]['extra']);
 }
Exemplo n.º 2
0
 /**
  * @return Logger
  */
 private function execute()
 {
     if ($this->logger->getWriters()->count() == 0) {
         return $this->logger->addWriter(new \Zend\Log\Writer\Null());
     }
 }