function RfcLogLevel::getLevels

Same name in other branches
  1. 9 core/lib/Drupal/Core/Logger/RfcLogLevel.php \Drupal\Core\Logger\RfcLogLevel::getLevels()
  2. 8.9.x core/lib/Drupal/Core/Logger/RfcLogLevel.php \Drupal\Core\Logger\RfcLogLevel::getLevels()
  3. 10 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 91

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.