class InMemoryLogger in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 tests/modules/search_api_solr_test/src/Logger/InMemoryLogger.php \Drupal\search_api_solr_test\Logger\InMemoryLogger
- 8 tests/modules/search_api_solr_test/src/Logger/InMemoryLogger.php \Drupal\search_api_solr_test\Logger\InMemoryLogger
- 8.2 tests/modules/search_api_solr_test/src/Logger/InMemoryLogger.php \Drupal\search_api_solr_test\Logger\InMemoryLogger
A simple in memory logger.
Hierarchy
- class \Drupal\search_api_solr_test\Logger\InMemoryLogger extends \Psr\Log\AbstractLogger
Expanded class hierarchy of InMemoryLogger
1 file declares its use of InMemoryLogger
- SolrBackendTestBase.php in tests/
src/ Kernel/ SolrBackendTestBase.php
File
- tests/
modules/ search_api_solr_test/ src/ Logger/ InMemoryLogger.php, line 10
Namespace
Drupal\search_api_solr_test\LoggerView source
class InMemoryLogger extends AbstractLogger {
private $messages = [];
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = []) {
$this->messages[] = [
'level' => $level,
'message' => $message,
'context' => $context,
];
}
/**
* Gets the last log message.
*/
public function getLastMessage() {
return end($this->messages);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InMemoryLogger:: |
private | property | ||
InMemoryLogger:: |
public | function | Gets the last log message. | |
InMemoryLogger:: |
public | function |