From 7b79b985710ab27e9442b6f180efc206b2626d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 12 Aug 2021 17:23:25 +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 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/System/Error/Logger.php b/System/Error/Logger.php index 637629a5..b8daef3a 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -11,13 +11,13 @@ namespace Kiri\Error; use Annotation\Inject; use Exception; -use Server\Events\OnAfterRequest; use Kiri\Abstracts\Component; use Kiri\Abstracts\Config; use Kiri\Core\Json; use Kiri\Events\EventProvider; use Kiri\Exception\ConfigException; use Kiri\Kiri; +use Server\Events\OnAfterRequest; use Swoole\Coroutine; use Throwable; @@ -142,16 +142,19 @@ class Logger extends Component /** * @param $message * @param string $method + * @throws ConfigException */ public function output($message, string $method = 'default') { -// if ($method !== 'error' && -// Config::get('environment', 'pro') == 'pro') { -// return; -// } -// if (str_contains($message, 'Event::rshutdown(): Event::wait()')) { -// return; -// } + if (Config::get('environment', 'pro') == 'pro') { + if ($method === 'error') { + echo $message; + } + return; + } + if (str_contains($message, 'Event::rshutdown(): Event::wait()')) { + return; + } echo $message; }