Skip to content

Commit ee35ff0

Browse files
authored
Merge pull request #160 from thePanz/fix-sf-event-logger-priority-and-event
Fix sfEventLogger: add priority and event.name overriding
2 parents 42302ed + 667ca46 commit ee35ff0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/log/sfEventLogger.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ public function initialize(sfEventDispatcher $dispatcher, $options = array())
2222
{
2323
$this->setLogLevel($this->options['level']);
2424
}
25+
26+
// Use the default "command.log" event if not overriden
27+
if (!isset($this->options['event_name'])) {
28+
$this->options['event_name'] = 'command.log';
29+
}
2530
}
2631

2732
/**
2833
* {@inheritDoc}
2934
*/
3035
protected function doLog($message, $priority)
3136
{
32-
$this->dispatcher->notify(new sfEvent($this, 'command.log', array($message)));
37+
$this->dispatcher->notify(new sfEvent($this, $this->options['event_name'], array($message, 'priority' => $priority)));
3338
}
3439
}

0 commit comments

Comments
 (0)