From bfc0729752320ddc078fd737ac1f162d7bed0bf7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 22 Jan 2019 01:30:52 -0500 Subject: [PATCH] Use new log levels in admin log settings page --- mod/admin.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 97d7a8bfd6..cc2256b73d 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -34,6 +34,7 @@ use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\Strings; use Friendica\Util\Temporal; +use Psr\Log\LogLevel; /** * Sets the current theme for theme settings pages. @@ -2497,7 +2498,7 @@ function admin_page_logs_post(App $a) $logfile = (!empty($_POST['logfile']) ? Strings::escapeTags(trim($_POST['logfile'])) : ''); $debugging = !empty($_POST['debugging']); - $loglevel = (!empty($_POST['loglevel']) ? intval(trim($_POST['loglevel'])) : 0); + $loglevel = defaults($_POST, 'loglevel', LogLevel::ERROR); Config::set('system', 'logfile', $logfile); Config::set('system', 'debugging', $debugging); @@ -2529,12 +2530,11 @@ function admin_page_logs_post(App $a) function admin_page_logs(App $a) { $log_choices = [ - Logger::WARNING => 'Warning', - Logger::INFO => 'Info', - Logger::TRACE => 'Trace', - Logger::DEBUG => 'Debug', - Logger::DATA => 'Data', - Logger::ALL => 'All' + LogLevel::ERROR => 'Error', + LogLevel::WARNING => 'Warning', + LogLevel::NOTICE => 'Notice', + LogLevel::INFO => 'Info', + LogLevel::DEBUG => 'Debug', ]; if (ini_get('log_errors')) { -- 2.39.5