Esempio n. 1
0
 public function testGetsetLevel()
 {
     $message = new AgaviLoggerMessage();
     $message->setLevel(AgaviLogger::DEBUG);
     $this->assertEquals(AgaviLogger::DEBUG, $message->getLevel());
     $message->setLevel(AgaviLogger::INFO);
     $this->assertEquals(AgaviLogger::INFO, $message->getLevel());
 }
 /**
  * Log a message.
  *
  * @param      AgaviLoggerMessage A Message instance.
  *
  * @author     Sean Kerr <*****@*****.**>
  * @since      0.9.0
  */
 public function log(AgaviLoggerMessage $message)
 {
     // get message level
     $msgLevel = $message->getLevel();
     if ($this->level & $msgLevel) {
         foreach ($this->appenders as $appender) {
             $appender->write($message);
         }
     }
 }
 /**
  * (non-PHPdoc)
  * @see AgaviLoggerLayout::format()
  */
 public function format(AgaviLoggerMessage $message)
 {
     return sprintf('[%s] [%s] %s', strftime($this->getParameter('timestamp_format', '%c')), self::levenToString($message->getLevel()), (string) $message);
 }