You are here

class Convert in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/Logger/Convert.php \Drupal\flysystem\Logger\Convert
  2. 2.0.x src/Logger/Convert.php \Drupal\flysystem\Logger\Convert
  3. 3.0.x src/Logger/Convert.php \Drupal\flysystem\Logger\Convert

Converts various log levels.

Hierarchy

  • class \Drupal\flysystem\Logger\Convert

Expanded class hierarchy of Convert

2 files declare their use of Convert
ConvertTest.php in tests/src/Unit/Logger/ConvertTest.php
flysystem.install in ./flysystem.install
Install, update and uninstall functions for the flysystem module.

File

src/Logger/Convert.php, line 10

Namespace

Drupal\flysystem\Logger
View source
class Convert {

  /**
   * Coverts from RFC 5424 to requirements error constants.
   *
   * @param int $level
   *   The RFC log value.
   *
   * @return int
   *   The requirements error value.
   */
  public static function rfcToHookRequirements($level) {
    if ($level <= RfcLogLevel::ERROR) {
      return REQUIREMENT_ERROR;
    }
    if ($level == RfcLogLevel::WARNING) {
      return REQUIREMENT_WARNING;
    }
    if ($level == RfcLogLevel::NOTICE || $level == RfcLogLevel::INFO) {
      return REQUIREMENT_INFO;
    }
    return REQUIREMENT_OK;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Convert::rfcToHookRequirements public static function Coverts from RFC 5424 to requirements error constants.