You are here

public static function MonologLogLevel::getLevels in Monolog 2.x

Same name and namespace in other branches
  1. 8 src/Logger/MonologLogLevel.php \Drupal\monolog\Logger\MonologLogLevel::getLevels()

Returns a list of severity levels, as defined Monolog\Logger.

Return value

array Array of the possible severity levels for log messages.

Related topics

File

src/Logger/MonologLogLevel.php, line 72

Class

MonologLogLevel

Namespace

Drupal\monolog\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;
}