class TestLogger in Feeds 8.3
Logger for testing log messages.
Hierarchy
- class \Drupal\Tests\feeds\Kernel\TestLogger implements \Psr\Log\LoggerInterface uses RfcLoggerTrait
Expanded class hierarchy of TestLogger
1 file declares its use of TestLogger
- FeedTest.php in tests/
src/ Kernel/ Entity/ FeedTest.php
File
- tests/
src/ Kernel/ TestLogger.php, line 11
Namespace
Drupal\Tests\feeds\KernelView source
class TestLogger implements LoggerInterface {
use RfcLoggerTrait;
/**
* Array of logged messages.
*
* @var array
*/
protected $messages = [];
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = []) {
$this->messages[] = strtr($message, $context);
}
/**
* Returns the logged messages.
*
* @return array
* An array of all logged messages.
*/
public function getMessages() : array {
return $this->messages;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
TestLogger:: |
protected | property | Array of logged messages. | |
TestLogger:: |
public | function | Returns the logged messages. | |
TestLogger:: |
public | function |
Logs with an arbitrary level. Overrides RfcLoggerTrait:: |