You are here

function monolog_logging_map_severity_level in Monolog 7

Same name and namespace in other branches
  1. 6 modules/monolog_logging/monolog_logging.module \monolog_logging_map_severity_level()

Maps a Watchdog severity level to Monolog severity levels.

Parameters

string $level: The Watchdog severity level.

Return value

int The Monolog severity level.

1 call to monolog_logging_map_severity_level()
monolog_logging_watchdog in modules/monolog_logging/monolog_logging.module
Implements hook_watchdog().

File

modules/monolog_logging/monolog_logging.module, line 148
Integrates Drupal's internal logging system with Monolog by routing watchdog messages to Monolog channels.

Code

function monolog_logging_map_severity_level($level) {
  $levels = array(
    WATCHDOG_DEBUG => Logger::DEBUG,
    WATCHDOG_INFO => Logger::INFO,
    WATCHDOG_NOTICE => Logger::NOTICE,
    WATCHDOG_WARNING => Logger::WARNING,
    WATCHDOG_ERROR => Logger::ERROR,
    WATCHDOG_CRITICAL => Logger::CRITICAL,
    WATCHDOG_ALERT => Logger::ALERT,
    WATCHDOG_EMERGENCY => Logger::EMERGENCY,
  );
  return isset($levels[$level]) ? $levels[$level] : Logger::NOTICE;
}