You are here

public static function ErrorLogConfigForm::submitForm in Error Log 8

Submits Error Log config form.

File

src/Form/ErrorLogConfigForm.php, line 52

Class

ErrorLogConfigForm
Implements an Error Log config form.

Namespace

Drupal\error_log\Form

Code

public static function submitForm(array &$form, FormStateInterface $form_state) {
  \Drupal::configFactory()
    ->getEditable('error_log.settings')
    ->set('log_levels', $form_state
    ->getValue([
    'error_log',
    'log_levels',
  ]))
    ->set('ignored_channels', array_map('trim', preg_split('/\\R/', $form_state
    ->getValue([
    'error_log',
    'ignored_channels',
  ]), -1, PREG_SPLIT_NO_EMPTY)))
    ->save();
}