class TestLog in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/error_service_test/src/Logger/TestLog.php \Drupal\error_service_test\Logger\TestLog
Throws an exception while logging an exception.
Hierarchy
- class \Drupal\error_service_test\Logger\TestLog implements LoggerInterface uses RfcLoggerTrait
Expanded class hierarchy of TestLog
See also
\Drupal\system\Tests\System\UncaughtExceptionTest::testLoggerException()
1 string reference to 'TestLog'
- error_service_test.services.yml in core/
modules/ system/ tests/ modules/ error_service_test/ error_service_test.services.yml - core/modules/system/tests/modules/error_service_test/error_service_test.services.yml
1 service uses TestLog
- logger.broken in core/
modules/ system/ tests/ modules/ error_service_test/ error_service_test.services.yml - Drupal\error_service_test\Logger\TestLog
File
- core/
modules/ system/ tests/ modules/ error_service_test/ src/ Logger/ TestLog.php, line 18 - Contains \Drupal\error_service_test\Logger\TestLog.
Namespace
Drupal\error_service_test\LoggerView source
class TestLog implements LoggerInterface {
use RfcLoggerTrait;
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = array()) {
$trigger = [
'%type' => 'Exception',
'@message' => 'Deforestation',
'%function' => 'Drupal\\error_service_test\\MonkeysInTheControlRoom->handle()',
'severity_level' => 3,
'channel' => 'php',
];
if (array_diff_assoc($trigger, $context) === []) {
throw new \Exception('Oh, oh, frustrated monkeys!');
}
}
}
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 | ||
TestLog:: |
public | function |
Logs with an arbitrary level. Overrides RfcLoggerTrait:: |