You are here

monolog.module in Monolog 2.x

Same filename and directory in other branches
  1. 8 monolog.module
  2. 6 monolog.module
  3. 7 monolog.module

File

monolog.module
View source
<?php

/**
 * @file
 * monolog.module.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function monolog_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // Main module help for the monolog module.
    case 'help.page.monolog':
      $readme = file_get_contents(__DIR__ . "/README.md");
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t("This module integrates Drupal with the fantastic Monolog library") . '</p>';
      $output .= '<pre>' . $readme . '</pre>';
      return $output;
  }
}

/**
 * Implements hook_mail().
 */
function monolog_mail($key, &$message, $params) {
  $content = $params['content'];
  $records = $params['records'];
  $message['subject'] = t('A new %level message has been logged', [
    '%level' => $records[0]['level_name'],
  ]);
  $message['body'][] = $content;
}

Functions

Namesort descending Description
monolog_help Implements hook_help().
monolog_mail Implements hook_mail().