78        $this->records = array();
 
   79        $this->recordsByLevel = array();
 
   84        return isset($this->recordsByLevel[
$level]);
 
   89        if (is_array($record)) {
 
   90            $record = $record[
'message'];
 
   94            return $rec[
'message'] === $record;
 
  101            return strpos($rec[
'message'], 
$message) !== 
false;
 
  108            return preg_match($regex, $rec[
'message']) > 0;
 
  114        if (!is_callable($predicate)) {
 
  115            throw new \InvalidArgumentException(
"Expected a callable for hasRecordThatSucceeds");
 
  118        if (!isset($this->recordsByLevel[
$level])) {
 
  122        foreach ($this->recordsByLevel[
$level] as 
$i => $rec) {
 
  123            if (call_user_func($predicate, $rec, 
$i)) {
 
  134    protected function write(array $record)
 
  136        $this->recordsByLevel[$record[
'level']][] = $record;
 
  137        $this->records[] = $record;
 
  142        if (preg_match(
'/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
 
  143            $genericMethod = $matches[1] . 
'Record' . $matches[3];
 
  144            $level = constant(
'Monolog\Logger::' . strtoupper($matches[2]));
 
  145            if (method_exists($this, $genericMethod)) {
 
  148                return call_user_func_array(array($this, $genericMethod), $args);
 
  152        throw new \BadMethodCallException(
'Call to undefined method ' . get_class($this) . 
'::' . $method . 
'()');
 
An exception for terminatinating execution or to throw for unit testing.
Base Handler class providing the Handler structure.
Used for testing purposes.
write(array $record)
{Writes the record down to the log of the implementing handler.void}
hasRecord($record, $level)
hasRecordThatContains($message, $level)
hasRecordThatMatches($regex, $level)
hasRecordThatPasses($predicate, $level)
catch(Exception $e) $message