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)) {
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 .
'()');
hasRecordThatPasses($predicate, $level)
hasRecord($record, $level)
Base Handler class providing the Handler structure.
Create styles array
The data for the language used.
hasRecordThatMatches($regex, $level)
hasRecordThatContains($message, $level)
Used for testing purposes.