8000 MonologBundle by Seldaek · Pull Request #111 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

MonologBundle #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[MonologBundle] Fix DebugHandler to match Symfony's interface
  • Loading branch information
Seldaek committed Feb 25, 2011
commit 0c007d7a5049306475f1b82b02fd3920503c7195
16 changes: 13 additions & 3 deletions src/Symfony/Bundle/MonologBundle/Logger/DebugHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\MonologBundle\Logger;

use Monolog\Handler\TestHandler;
use Monolog\Logger;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;

/**
Expand All @@ -27,14 +26,25 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface
*/
public function getLogs()
{
return $this->messages;
$records = array();
foreach ($this->records as $record) {
$records[] = array(
'timestamp' => $record['datetime']->getTimestamp(),
'message' => $record['message'],
'priority' => $record['level'],
'priorityName' => $record['level_name'],
);
}
return $records;
}

/**
* {@inheritdoc}
*/
public function countErrors()
{
return count($this->messagesByLevel[Logger::ERROR]);
return isset($this->recordsByLevel[\Monolog\Logger::ERROR])
? count($this->recordsByLevel[\Monolog\Logger::ERROR])
: 0;
}
}
0