78        $this->records = array();
 
   79        $this->recordsByLevel = array();
 
   84        return isset($this->recordsByLevel[
$level]);
 
   93        if (is_string($record)) {
 
   94            $record = array(
'message' => $record);
 
   98            if ($rec[
'message'] !== $record[
'message']) {
 
  101            if (isset($record[
'context']) && $rec[
'context'] !== $record[
'context']) {
 
  111            return strpos($rec[
'message'], 
$message) !== 
false;
 
  118            return preg_match($regex, $rec[
'message']) > 0;
 
  124        if (!is_callable($predicate)) {
 
  125            throw new \InvalidArgumentException(
"Expected a callable for hasRecordThatSucceeds");
 
  128        if (!isset($this->recordsByLevel[
$level])) {
 
  132        foreach ($this->recordsByLevel[
$level] as 
$i => $rec) {
 
  133            if (call_user_func($predicate, $rec, 
$i)) {
 
  144    protected function write(array $record)
 
  146        $this->recordsByLevel[$record[
'level']][] = $record;
 
  147        $this->records[] = $record;
 
  152        if (preg_match(
'/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
 
  153            $genericMethod = $matches[1] . (
'Records' !== $matches[3] ? 
'Record' : 
'') . $matches[3];
 
  154            $level = constant(
'Monolog\Logger::' . strtoupper($matches[2]));
 
  155            if (method_exists($this, $genericMethod)) {
 
  158                return call_user_func_array(array($this, $genericMethod), $args);
 
  162        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