From e59e4bb3e7c80aba50e7255021f04fe8c15031bb Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 15 May 2018 17:37:29 +0200 Subject: allow custom stack tarce for compaction --- it_debug.class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/it_debug.class b/it_debug.class index 89d31e7..b53a192 100644 --- a/it_debug.class +++ b/it_debug.class @@ -167,6 +167,7 @@ static function dump($args) * @param $p['levels'] number of stack levels to return (default: 0 = all) * @param $p['skiplevels'] number of stack levels to omit * @param $p['skipfiles'] regular expression of filenames to omit + * @param $p['trace'] Stack trace to compact */ static function backtrace($p = array()) { @@ -175,7 +176,7 @@ static function backtrace($p = array()) $p += array('levels' => 0, 'skiplevels'=> 0, 'skipfiles' => "###"); - foreach (array_slice(debug_backtrace(@constant('DEBUG_BACKTRACE_IGNORE_ARGS')), $p['skiplevels']) as $call) + foreach ($p['trace'] ?: array_slice(debug_backtrace(@constant('DEBUG_BACKTRACE_IGNORE_ARGS')), $p['skiplevels']) as $call) { if (($fn = $call['file']) && !it::match($p['skipfiles'], $call['file'])) { -- cgit v1.2.3