class TestLogger in Search API Saved Searches 8
Provides a logger that throws exceptions when logging errors.
Hierarchy
- class \Drupal\Core\Logger\LoggerChannel implements LoggerChannelInterface uses \Psr\Log\LoggerTrait
- class \Drupal\Tests\search_api_saved_searches\Kernel\TestLogger implements LoggerChannelFactoryInterface uses RfcLoggerTrait
Expanded class hierarchy of TestLogger
1 file declares its use of TestLogger
- IntegrationTest.php in tests/
src/ Functional/ IntegrationTest.php
File
- tests/
src/ Kernel/ TestLogger.php, line 14
Namespace
Drupal\Tests\search_api_saved_searches\KernelView source
class TestLogger extends LoggerChannel implements LoggerChannelFactoryInterface {
use RfcLoggerTrait;
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = []) {
if ($level < RfcLogLevel::INFO) {
$message = strtr($message, $context);
throw new \Exception($message);
}
}
/**
* {@inheritdoc}
*/
public function get($channel) {
return $this;
}
/**
* {@inheritdoc}
*/
public function addLogger(LoggerInterface $logger, $priority = 0) {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LoggerChannel:: |
protected | property | Number of times LoggerChannel::log() has been called for a single message. | |
LoggerChannel:: |
protected | property | The name of the channel of this logger instance. | |
LoggerChannel:: |
protected | property | The current user object. | |
LoggerChannel:: |
protected | property | Map of PSR3 log constants to RFC 5424 log constants. | |
LoggerChannel:: |
protected | property | An array of arrays of \Psr\Log\LoggerInterface keyed by priority. | |
LoggerChannel:: |
protected | property | The request stack object. | |
LoggerChannel:: |
constant | Maximum call depth to self::log() for a single log message. | ||
LoggerChannel:: |
public | function |
Sets the current user. Overrides LoggerChannelInterface:: |
|
LoggerChannel:: |
public | function |
Sets the loggers for this channel. Overrides LoggerChannelInterface:: |
|
LoggerChannel:: |
public | function |
Sets the request stack. Overrides LoggerChannelInterface:: |
|
LoggerChannel:: |
protected | function | Sorts loggers according to priority. | |
LoggerChannel:: |
public | function | Constructs a LoggerChannel object | |
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:: |
public | function |
Adds a logger. Overrides LoggerChannel:: |
|
TestLogger:: |
public | function |
Retrieves the registered logger for the requested channel. Overrides LoggerChannelFactoryInterface:: |
|
TestLogger:: |
public | function |
Logs with an arbitrary level. Overrides RfcLoggerTrait:: |