1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Refactored writeZendMonitorCustomEvent signature to provide better testability

This commit is contained in:
ChristianB
2013-01-30 21:42:59 +01:00
parent 4eb6011dc1
commit b4b2d91c67
2 changed files with 15 additions and 8 deletions

View File

@@ -62,18 +62,20 @@ class ZendMonitorHandler extends AbstractProcessingHandler
{
if ($this->isZendServer()) {
$formatter = new NormalizerFormatter();
$this->writeZendMonitorCustomEvent($formatter->format($record));
$record = $formatter->format($record);
$this->writeZendMonitorCustomEvent($record['level'], $record['message']);
}
}
/**
* Write a record to Zend Monitor
*
* @param array $record
* @param int $level
* @param string $message
*/
protected function writeZendMonitorCustomEvent(array $record)
protected function writeZendMonitorCustomEvent($level, $message)
{
zend_monitor_custom_event($this->levelMap[$record['level']], $record['message'], $record['formatted']);
zend_monitor_custom_event($level, $message);
}
/**