You are here

public static function RfcLogLevel::getLevels in Service Container 7.2

Same name and namespace in other branches
  1. 7 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

File

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 TranslationWrapper('Emergency'),
      static::ALERT => new TranslationWrapper('Alert'),
      static::CRITICAL => new TranslationWrapper('Critical'),
      static::ERROR => new TranslationWrapper('Error'),
      static::WARNING => new TranslationWrapper('Warning'),
      static::NOTICE => new TranslationWrapper('Notice'),
      static::INFO => new TranslationWrapper('Info'),
      static::DEBUG => new TranslationWrapper('Debug'),
    ];
  }
  return static::$levels;
}