From 115ec20ac90b20c55a638ec22a210e3c8ed67265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=A3=E8=A8=80=E5=B0=B1=E6=98=AFSiam?= <59419979@qq.com> Date: Mon, 24 May 2021 16:42:57 +0800 Subject: [PATCH] =?UTF-8?q?fixes:=20=E5=9C=A8=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E5=8A=A8=E6=80=81=E6=9B=B4=E6=94=B9debug=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=B3=A8=E5=85=A5=E4=BA=86trace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TraceDebug.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/TraceDebug.php b/src/TraceDebug.php index 5ed9cbf..9db54a9 100644 --- a/src/TraceDebug.php +++ b/src/TraceDebug.php @@ -56,10 +56,8 @@ public function __construct(App $app, Config $config) */ public function handle($request, Closure $next) { - $debug = $this->app->isDebug(); - // 注册日志监听 - if ($debug) { + if ($this->app->isDebug()) { $this->log = []; $this->app->event->listen(LogWrite::class, function ($event) { if (empty($this->config['channel']) || $this->config['channel'] == $event->channel) { @@ -71,7 +69,7 @@ public function handle($request, Closure $next) $response = $next($request); // Trace调试注入 - if ($debug) { + if ($this->app->isDebug()) { $data = $response->getContent(); $this->traceDebug($response, $data); $response->content($data);