Beispiel #1
0
 private function formatLevel(Log $log, $params)
 {
     switch ($log->getLevel()) {
         case LogLevel::EMERG:
             $cnt = 6;
             break;
         case LogLevel::CRIT:
             $cnt = 6;
             break;
         case LogLevel::ALERT:
             $cnt = 3;
             break;
         case LogLevel::ERR:
             $cnt = 2;
             break;
         case LogLevel::WARNING:
             $cnt = 1;
             break;
         case LogLevel::NOTICE:
         case LogLevel::INFO:
         case LogLevel::DEBUG:
             $cnt = 0;
             break;
     }
     $ast = str_repeat('*', $cnt);
     return sprintf('%3$s%s.%s%3$s', $log->getName(), LogLevel::toString($log->getLevel()), $ast);
 }
Beispiel #2
0
 protected function __construct(Hash $options)
 {
     $this->_level = LogLevel::toInt($options->getVal('level', 'debug'));
 }
Beispiel #3
0
 public function phpErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
 {
     // ログを作成
     $this->log(LogLevel::phpToNora($errno), $message = sprintf("[%s] %s on %s(%s)", $errno, $errstr, $errfile, $errline));
 }