[HttpKernel] RouterListener uses "context" argument when logging route

This commit is contained in:
Iltar van der Berg 2014-11-28 15:41:55 +01:00
parent d277c16a27
commit 448c03f1f2

View File

@ -128,7 +128,7 @@ class RouterListener implements EventSubscriberInterface
}
if (null !== $this->logger) {
$this->logger->info(sprintf('Matched route "%s" (parameters: %s)', $parameters['_route'], $this->parametersToString($parameters)));
$this->logger->info(sprintf('Matched route "%s"', $parameters['_route']), $parameters);
}
$request->attributes->add($parameters);
@ -150,16 +150,6 @@ class RouterListener implements EventSubscriberInterface
}
}
private function parametersToString(array $parameters)
{
$pieces = array();
foreach ($parameters as $key => $val) {
$pieces[] = sprintf('"%s": "%s"', $key, (is_string($val) ? $val : json_encode($val)));
}
return implode(', ', $pieces);
}
public static function getSubscribedEvents()
{
return array(