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);