示例#1
0
 /**
  * Dispatches a logging request.
  *
  * @param string $message  The message to log.
  * @param int    $priority The logging priority, the lower,the more
  *     important. Ranges from 1 to 7
  *
  * @return void
  */
 public function log($message, $priority = 6)
 {
     Dispatcher::getInstance()->dispatch('system.log', LogEvent::createInstance($this)->setMessage($message)->setPriority($priority));
 }
示例#2
0
 /**
  * Dispatches a logging request.
  *
  * @param string   $message  The message to log.
  * @param string   $priority The logging priority as declared in the LogLevel PSR-3 class.
  * @param string[] $parameters
  *
  * @return void
  */
 protected function log($message, $priority = LogLevel::INFO, $parameters = array())
 {
     Dispatcher::getInstance()->dispatch('system.log', LogEvent::createInstance($this->parser)->setContext($parameters)->setMessage($message)->setPriority($priority));
 }
示例#3
0
 /**
  * Dispatches a logging request.
  *
  * @param string $message  The message to log.
  * @param int    $priority The logging priority, the lower,
  *  the more important. Ranges from 1 to 7
  *
  * @return void
  */
 public function log($message, $priority = 6)
 {
     $this->dispatch('system.log', \phpDocumentor\Event\LogEvent::createInstance($this)->setMessage($message)->setPriority($priority));
 }
 /**
  * Dispatches a parser error to be logged.
  *
  * @param string   $type      The logging priority as string
  * @param string   $code      The message to log.
  * @param string   $line      The line number where the error occurred..
  * @param string[] $variables an array with message substitution variables.
  *
  * @return void
  */
 public function logParserError($type, $code, $line, $variables = array())
 {
     $message = $this->__($code, $variables);
     $this->log($message, LogLevel::ERROR);
     $this->dispatch('parser.log', LogEvent::createInstance($this)->setMessage($message)->setType($type)->setCode($code)->setLine($line));
 }
示例#5
0
 /**
  * Dispatches a logging request.
  *
  * @param string $message  The message to log.
  * @param int    $priority The logging priority, the lower,
  *  the more important. Ranges from 1 to 7
  *
  * @return void
  */
 public function log($message, $priority = 6)
 {
     if (class_exists('phpDocumentor\\Event\\Dispatcher')) {
         Dispatcher::getInstance()->dispatch('system.log', LogEvent::createInstance($this)->setMessage($message)->setPriority($priority));
     }
 }