View source
<?php
use Drupal\Core\Routing\RouteMatchInterface;
function monolog_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
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;
}
}
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;
}