From d67b32795af81651fb55bd4c24d5d909bae64c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 12 Aug 2021 17:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Error/Logger.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/System/Error/Logger.php b/System/Error/Logger.php index b8daef3a..9d364537 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -165,18 +165,7 @@ class Logger extends Component */ public function getLastError(string $application = 'app'): mixed { - return $this->logs[$application] ?? null; - - foreach ($this->logs as $val) { - if ($val[0] != $application) { - continue; - } - $filetype[] = $val[1]; - } - if (empty($filetype)) { - return 'Unknown error.'; - } - return end($filetype); + return $this->logs[$application] ?? 'Unknown error.'; } /**