You are here

public static function LogMessage::getLevels in File Log 8

Same name and namespace in other branches
  1. 2.0.x src/LogMessage.php \Drupal\filelog\LogMessage::getLevels()

Get untranslated level strings.

Return value

string[] An associative array of RFC levels to labels.

2 calls to LogMessage::getLevels()
FileLogTest::providerFileLog in tests/src/Unit/FileLogTest.php
Provide data for the level-checking test.
FileLogTokenTest::testTokens in tests/src/Unit/FileLogTokenTest.php
Test the tokens of the log message.

File

src/LogMessage.php, line 122

Class

LogMessage
Represents a single log event.

Namespace

Drupal\filelog

Code

public static function getLevels() : array {
  if (!static::$levels) {
    static::$levels = RfcLogLevel::getLevels();
    foreach (static::$levels as $id => $label) {

      /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */
      static::$levels[$id] = $label
        ->getUntranslatedString();
    }
  }
  return static::$levels;
}