trait RfcLoggerTrait in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Logger/RfcLoggerTrait.php \Drupal\Core\Logger\RfcLoggerTrait
A copy of \Psr\Log\LoggerTrait that uses RFC 5424 compliant log levels.
Internal Drupal logger implementations should use this trait instead of \Psr\Log\LoggerTrait. Callers of those implementations are responsible for translating any other log level format to RFC 5424 compliant integers.
Hierarchy
- trait \Drupal\Core\Logger\RfcLoggerTrait
See also
https://groups.google.com/forum/#!topic/php-fig/Rc5YDhNdGz4
https://www.drupal.org/node/2267545
3 files declare their use of RfcLoggerTrait
- DbLog.php in core/
modules/ dblog/ src/ Logger/ DbLog.php - Contains \Drupal\dblog\Logger\DbLog.
- SysLog.php in core/
modules/ syslog/ src/ Logger/ SysLog.php - Contains \Drupal\syslog\Logger\SysLog.
- TestLog.php in core/
modules/ system/ tests/ modules/ error_service_test/ src/ Logger/ TestLog.php - Contains \Drupal\error_service_test\Logger\TestLog.
File
- core/
lib/ Drupal/ Core/ Logger/ RfcLoggerTrait.php, line 20 - Contains \Drupal\Core\Logger\RfcLoggerTrait.
Namespace
Drupal\Core\LoggerView source
trait RfcLoggerTrait {
/**
* {@inheritdoc}
*/
public function emergency($message, array $context = array()) {
$this
->log(RfcLogLevel::EMERGENCY, $message, $context);
}
/**
* {@inheritdoc}
*/
public function alert($message, array $context = array()) {
$this
->log(RfcLogLevel::ALERT, $message, $context);
}
/**
* {@inheritdoc}
*/
public function critical($message, array $context = array()) {
$this
->log(RfcLogLevel::CRITICAL, $message, $context);
}
/**
* {@inheritdoc}
*/
public function error($message, array $context = array()) {
$this
->log(RfcLogLevel::ERROR, $message, $context);
}
/**
* {@inheritdoc}
*/
public function warning($message, array $context = array()) {
$this
->log(RfcLogLevel::WARNING, $message, $context);
}
/**
* {@inheritdoc}
*/
public function notice($message, array $context = array()) {
$this
->log(RfcLogLevel::NOTICE, $message, $context);
}
/**
* {@inheritdoc}
*/
public function info($message, array $context = array()) {
$this
->log(RfcLogLevel::INFO, $message, $context);
}
/**
* {@inheritdoc}
*/
public function debug($message, array $context = array()) {
$this
->log(RfcLogLevel::DEBUG, $message, $context);
}
/**
* {@inheritdoc}
*/
public abstract function log($level, $message, array $context = array());
}
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:: |
abstract public | function | 3 | |
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function |