You are here

class MonologLogLevel in Monolog 2.x

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

Hierarchy

Expanded class hierarchy of MonologLogLevel

1 file declares its use of MonologLogLevel
LoggerTest.php in tests/src/Unit/Logger/LoggerTest.php

File

src/Logger/MonologLogLevel.php, line 15

Namespace

Drupal\monolog\Logger
View source
class MonologLogLevel {

  /**
   * Log message severity -- Emergency: system is unusable.
   */
  const EMERGENCY = MonologLogger::EMERGENCY;

  /**
   * Log message severity -- Alert: action must be taken immediately.
   */
  const ALERT = MonologLogger::ALERT;

  /**
   * Log message severity -- Critical conditions.
   */
  const CRITICAL = MonologLogger::CRITICAL;

  /**
   * Log message severity -- Error conditions.
   */
  const ERROR = MonologLogger::ERROR;

  /**
   * Log message severity -- Warning conditions.
   */
  const WARNING = MonologLogger::WARNING;

  /**
   * Log message severity -- Normal but significant conditions.
   */
  const NOTICE = MonologLogger::NOTICE;

  /**
   * Log message severity -- Informational messages.
   */
  const INFO = MonologLogger::INFO;

  /**
   * Log message severity -- Debug-level messages.
   */
  const DEBUG = MonologLogger::DEBUG;

  /**
   * An array with the severity levels as keys and labels as values.
   *
   * @var array
   */
  protected static $levels;

  /**
   * Returns a list of severity levels, as defined Monolog\Logger.
   *
   * @return array
   *   Array of the possible severity levels for log messages.
   *
   * @ingroup logging_severity_levels
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MonologLogLevel::$levels protected static property An array with the severity levels as keys and labels as values.
MonologLogLevel::ALERT constant Log message severity -- Alert: action must be taken immediately.
MonologLogLevel::CRITICAL constant Log message severity -- Critical conditions.
MonologLogLevel::DEBUG constant Log message severity -- Debug-level messages.
MonologLogLevel::EMERGENCY constant Log message severity -- Emergency: system is unusable.
MonologLogLevel::ERROR constant Log message severity -- Error conditions.
MonologLogLevel::getLevels public static function Returns a list of severity levels, as defined Monolog\Logger.
MonologLogLevel::INFO constant Log message severity -- Informational messages.
MonologLogLevel::NOTICE constant Log message severity -- Normal but significant conditions.
MonologLogLevel::WARNING constant Log message severity -- Warning conditions.