You are here

public static function RfcLogLevel::getLevels in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Logger/RfcLogLevel.php \Drupal\Core\Logger\RfcLogLevel::getLevels()

Returns a list of severity levels, as defined in RFC 5424.

Return value

array Array of the possible severity levels for log messages.

See also

http://tools.ietf.org/html/rfc5424

Related topics

2 calls to RfcLogLevel::getLevels()
DbLogController::eventDetails in core/modules/dblog/src/Controller/DbLogController.php
Displays details about a specific database log message.
dblog_filters in core/modules/dblog/dblog.admin.inc
Creates a list of database log administration filters that can be applied.

File

core/lib/Drupal/Core/Logger/RfcLogLevel.php, line 96
Contains \Drupal\Core\Logger\RfcLogLevel.

Class

RfcLogLevel
Defines various logging severity levels.

Namespace

Drupal\Core\Logger

Code

public static function getLevels() {
  if (!static::$levels) {
    static::$levels = [
      static::EMERGENCY => new TranslatableMarkup('Emergency'),
      static::ALERT => new TranslatableMarkup('Alert'),
      static::CRITICAL => new TranslatableMarkup('Critical'),
      static::ERROR => new TranslatableMarkup('Error'),
      static::WARNING => new TranslatableMarkup('Warning'),
      static::NOTICE => new TranslatableMarkup('Notice'),
      static::INFO => new TranslatableMarkup('Info'),
      static::DEBUG => new TranslatableMarkup('Debug'),
    ];
  }
  return static::$levels;
}