Ejemplo n.º 1
0
 /**
  * Log message
  *
  * @author  Florian Preusner
  * @version 2.1
  * @since   2014-11
  *
  * @param   string $level
  * @param   string $message
  * @param   array  $context
  *
  * @return  void
  */
 public function log($level, $message, array $context = array())
 {
     $request = new LogRequest($context['request']);
     $response = new LogResponse($context['response']);
     $message = new LogMessage($message);
     $message->setLevel($level);
     $message->setRequest($request);
     $message->setResponse($response);
     $this->messages[] = $message;
 }
Ejemplo n.º 2
0
 /**
  * Log message
  *
  * @author  Florian Preusner
  * @version 2.1
  * @since   2014-11
  *
  * @param   string $level
  * @param   string $message
  * @param   array  $context
  *
  * @return  void
  */
 public function log($level, $message, array $context = array())
 {
     $message = new LogMessage($message);
     $message->setLevel($level);
     if ($context) {
         if (isset($context['request'])) {
             $message->setRequest(new LogRequest($context['request']));
         }
         if (isset($context['response'])) {
             $message->setResponse(new LogResponse($context['response']));
         }
     }
     $this->messages[] = $message;
 }