From 273bc9d970a95db7ed50aecedd462143a69c1c28 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 14 Jun 2019 15:12:48 +0300 Subject: [PATCH] Profiler: remove some noise --- system/src/Grav/Common/Debugger.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index 39862874a..0e66ebf21 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -577,10 +577,16 @@ class Debugger $method = $this->parseProfilerCall(array_pop($parts)); $context = $this->parseProfilerCall(array_pop($parts)); + // Skip redundant method calls. if ($method === $context && $method === 'Grav\Framework\RequestHandler\RequestHandler::handle()') { continue; } + // Do not profile library calls. + if (strpos($context, 'Grav\\') !== 0) { + continue; + } + $table[] = [ 'Context' => $context, 'Method' => $method, @@ -608,13 +614,16 @@ class Debugger return $call; } + // It is also possible to display twig files, but they are being logged in views. + /* if (strpos($class, '__TwigTemplate_') === 0 && class_exists($class)) { $env = new Environment(); - /** @var Template $template */ + / ** @var Template $template * / $template = new $class($env); return $template->getTemplateName(); } + */ return "{$class}::{$call}()"; }