function tmgmt_smartling_log_settings_form_system_logging_settings_alter in TMGMT Translator Smartling 8.3
Same name and namespace in other branches
- 8.4 modules/tmgmt_smartling_log_settings/tmgmt_smartling_log_settings.module \tmgmt_smartling_log_settings_form_system_logging_settings_alter()
Implements hook_form_FORM_ID_alter().
File
- modules/
tmgmt_smartling_log_settings/ tmgmt_smartling_log_settings.module, line 14
Code
function tmgmt_smartling_log_settings_form_system_logging_settings_alter(&$form, FormStateInterface $form_state) {
$config = \Drupal::configFactory()
->getEditable('tmgmt_smartling_log_settings.settings');
$form['tmgmt_smartling_log_settings_severity_mapping'] = [
'#type' => 'textarea',
'#title' => t('Filter out log messages by channel and severity level'),
'#default_value' => $config
->get('severity_mapping'),
'#attributes' => [
'placeholder' => '[channel_name]: [severity_level]',
],
'#description' => t('Set severity level for each channel. Valid severity levels are: debug, info, notice, warning, error, critical, alert and emergency. One config per line.'),
];
$form['#validate'][] = 'tmgmt_smartling_log_settings_logging_settings_validate';
$form['#submit'][] = 'tmgmt_smartling_log_settings_logging_settings_submit';
}