Skip to content

Commit

Permalink
[FrameworkBundle] made logger optional in ExceptionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Aug 18, 2010
1 parent 47a26a0 commit 42cad4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionManager.php
Expand Up @@ -29,7 +29,7 @@ class ExceptionManager
protected $logger;
protected $currentContent;

public function __construct(\Exception $exception, Request $request, DebugLoggerInterface $logger)
public function __construct(\Exception $exception, Request $request, DebugLoggerInterface $logger = null)
{
$this->exception = $exception;
$this->request = $request;
Expand Down Expand Up @@ -58,11 +58,15 @@ public function getLogger()

public function getLogs()
{
return $this->logger->getLogs();
return null === $this->logger ? array() : $this->logger->getLogs();
}

public function countErrors()
{
if (null === $this->logger) {
return 0;
}

$errors = 0;
foreach ($this->logger->getLogs() as $log) {
if ('ERR' === $log['priorityName']) {
Expand Down

0 comments on commit 42cad4e

Please sign in to comment.