X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FForm%2FLoggingForm.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FForm%2FLoggingForm.php;h=a305a4ff1d53bda8a8d471d8f83dd6243fd67722;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/system/src/Form/LoggingForm.php b/web/core/modules/system/src/Form/LoggingForm.php new file mode 100644 index 000000000..a305a4ff1 --- /dev/null +++ b/web/core/modules/system/src/Form/LoggingForm.php @@ -0,0 +1,59 @@ +config('system.logging'); + $form['error_level'] = [ + '#type' => 'radios', + '#title' => t('Error messages to display'), + '#default_value' => $config->get('error_level'), + '#options' => [ + ERROR_REPORTING_HIDE => t('None'), + ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'), + ERROR_REPORTING_DISPLAY_ALL => t('All messages'), + ERROR_REPORTING_DISPLAY_VERBOSE => t('All messages, with backtrace information'), + ], + '#description' => t('It is recommended that sites running on production environments do not display any errors.'), + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->config('system.logging') + ->set('error_level', $form_state->getValue('error_level')) + ->save(); + + parent::submitForm($form, $form_state); + } + +}