Exemple #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;
 }
 /**
  * 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;
 }