You are here

class RfcLogLevel in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Core/Logger/RfcLogLevel.php \Drupal\Core\Logger\RfcLogLevel

Defines various logging severity levels.

Hierarchy

Expanded class hierarchy of RfcLogLevel

Related topics

File

lib/Drupal/Core/Logger/RfcLogLevel.php, line 38
Contains \Drupal\Core\Logger\RfcLogLevel.

Namespace

Drupal\Core\Logger
View source
class RfcLogLevel {

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

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

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

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

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

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

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

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

  /**
   * 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 in RFC 5424.
   *
   * @return array
   *   Array of the possible severity levels for log messages.
   *
   * @see http://tools.ietf.org/html/rfc5424
   * @ingroup logging_severity_levels
   */
  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;
  }

}

Members

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