debug() public method

public debug ( $message, array $context = [] )
$context array
 /**
  * Cache an array of resources into the given cache
  * @param  array $resources
  * @return void
  */
 public function cacheResources(array $resources)
 {
     $cache = new ConfigCache($this->getCacheFileLocation(), $this->debug);
     $content = sprintf('<?php return %s;', var_export($resources, true));
     $cache->write($content);
     $this->logger->debug('Writing translation resources to cache file.');
 }
 /**
  * Assigns the currently logged in user to a Comment.
  *
  * @param  \FOS\CommentBundle\Event\CommentEvent $event
  * @return void
  */
 public function blame(CommentEvent $event)
 {
     $comment = $event->getComment();
     if (null === $this->securityContext) {
         if ($this->logger) {
             $this->logger->debug("Comment Blamer did not receive the security.context service.");
         }
         return;
     }
     if (!$comment instanceof SignedCommentInterface) {
         if ($this->logger) {
             $this->logger->debug("Comment does not implement SignedCommentInterface, skipping");
         }
         return;
     }
     if (null === $this->securityContext->getToken()) {
         if ($this->logger) {
             $this->logger->debug("There is no firewall configured. We cant get a user.");
         }
         return;
     }
     if (null === $comment->getAuthor() && $this->securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
         $comment->setAuthor($this->securityContext->getToken()->getUser());
     }
 }
 /**
  * @param mixed $level
  * @param string $message
  * @param array $context
  * @return null
  * @throws PsrInvalidArgumentException
  */
 public function log($level, $message, array $context = array())
 {
     switch ($level) {
         case PsrLogLevel::ALERT:
             $this->symfonyLogger->alert($message, $context);
             break;
         case PsrLogLevel::CRITICAL:
             $this->symfonyLogger->crit($message, $context);
             break;
         case PsrLogLevel::DEBUG:
             $this->symfonyLogger->debug($message, $context);
             break;
         case PsrLogLevel::EMERGENCY:
             $this->symfonyLogger->emerg($message, $context);
             break;
         case PsrLogLevel::ERROR:
             $this->symfonyLogger->err($message, $context);
             break;
         case PsrLogLevel::INFO:
             $this->symfonyLogger->info($message, $context);
             break;
         case PsrLogLevel::NOTICE:
             $this->symfonyLogger->notice($message, $context);
             break;
         case PsrLogLevel::WARNING:
             $this->symfonyLogger->warn($message, $context);
             break;
         default:
             throw new PsrInvalidArgumentException(sprintf('Loglevel "%s" not valid, use constants from "%s"', $level, "Psr\\Log\\LogLevel"));
             break;
     }
     return null;
 }
 /**
  * @param string $action
  * @return object
  */
 private function findControllerWithAction($action)
 {
     $this->logger->debug('Trying method "' . $action . '"');
     if (method_exists($this->getControllerObject(), $action)) {
         return array($this->getControllerObject(), $action);
     }
     return null;
 }
 public function onAuthenticationSuccess(Request $request, TokenInterface $token)
 {
     $this->logger->debug('After login');
     $path = $this->defaultPath;
     if ($request->getSession()->has('order')) {
         $this->logger->debug('Order to authenticate');
         $request->getSession()->get('order')->authenticateWith($token->getUser());
         $path = $this->orderNextStepRoute;
     }
     $this->logger->debug("Redirect to {$path}");
     return $this->httpUtils->createRedirectResponse($request, $path);
 }
Example #6
0
 /**
  * A convenience function for logging a debug event.
  *
  * @param mixed $message the message to log.
  */
 public function debug($message)
 {
     $this->queries[] = $message;
     if (null !== $this->logger) {
         $this->logger->debug($message);
     }
 }
 public function getHDMovieNotViewed($channel, $codec, $order = 'create', $sens = 'DESC')
 {
     $qb = $this->queryHDMovies();
     $qb->andWhere($qb->expr()->notIn('mov.mapper', $this->queryNotViewed()->getDQL()));
     $this->queryAudio($qb, $channel, $codec);
     $this->logger->debug('VALUE field in HDNotView : ' . $order);
     $this->queryOrderField($qb, $order, $sens);
     return $qb->getQuery()->getResult();
 }
 /**
  * Assigns the currently logged in user to a Comment.
  *
  * @param \FOS\CommentBundle\Event\CommentEvent $event
  */
 public function blame(CommentEvent $event)
 {
     $comment = $event->getComment();
     if (!$comment instanceof SignedCommentInterface) {
         if ($this->logger) {
             $this->logger->debug("Comment does not implement SignedCommentInterface, skipping");
         }
         return;
     }
     if (null === $this->tokenStorage->getToken()) {
         if ($this->logger) {
             $this->logger->debug("There is no firewall configured. We cant get a user.");
         }
         return;
     }
     if (null === $comment->getAuthor() && $this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
         $comment->setAuthor($this->tokenStorage->getToken()->getUser());
     }
 }
Example #9
0
 /**
  * A convenience function for logging a debug event.
  *
  * @param mixed $message the message to log.
  */
 public function debug($message)
 {
     $add = true;
     if (null !== $this->stopwatch) {
         $trace = debug_backtrace();
         $method = $trace[2]['args'][2];
         $watch = 'Propel Query ' . (count($this->queries) + 1);
         if ('PropelPDO::prepare' === $method) {
             $this->isPrepared = true;
             $this->stopwatch->start($watch, 'propel');
             $add = false;
         } elseif ($this->isPrepared) {
             $this->isPrepared = false;
             $this->stopwatch->stop($watch);
         }
     }
     if ($add) {
         $this->queries[] = $message;
         if (null !== $this->logger) {
             $this->logger->debug($message);
         }
     }
 }
Example #10
0
 /**
  * A convenience function for logging a debug event.
  *
  * @param mixed $message the message to log.
  */
 public function debug($message)
 {
     $this->queries[] = $message;
     $this->logger->debug($message);
 }
Example #11
0
 /**
  * log message to debug log (if logger has been set)
  * @param string $message
  */
 protected function log($message)
 {
     if ($this->logger) {
         $this->logger->debug(sprintf('%s:%s', $this->getLogIdentification(), $message));
     }
 }
Example #12
0
 /**
  * Log debug messages if the logger is set.
  *
  * @param string $message
  */
 private function logDebug($message)
 {
     if ($this->logger) {
         $this->logger->debug($message);
     }
 }
 public function __invoke($message)
 {
     $this->logger->debug($message);
 }
Example #14
0
 /**
  * log message to debug log (if logger has been set)
  * @param string $message
  */
 protected function log($message)
 {
     if ($this->logger) {
         $this->logger->debug(sprintf('TournamentEngine:%s', $message));
     }
 }
 public function debug($msg)
 {
     if ($this->logger) {
         $this->logger->debug("{$msg} (PID " . getmypid() . ", microtime " . microtime() . ")");
     }
 }
 public function onSalesforceClientResponse(Event\ResponseEvent $event)
 {
     if (true === $this->logging) {
         $this->logger->debug('[Salesforce] response:', array($event->getResponse()));
     }
 }
 /**
  * Logs the given message if a logger is available.
  *
  * @param string $message
  */
 protected function debug($message)
 {
     if ($this->logger) {
         $this->logger->debug($message, array('pid' => getmypid()));
     }
 }