diff options
author | Christian Schneider | 2007-09-21 15:27:13 +0000 |
---|---|---|
committer | Christian Schneider | 2007-09-21 15:27:13 +0000 |
commit | d7177f246e63afb2777eb8418cc4e5e3c17e9698 (patch) | |
tree | 9d2d09c6d2a2b8bf50e29d580ab1aba1e3d7be86 /it_debug.class | |
parent | 622c7b7aa48ab4a4544fdc89af91bcff6c219c75 (diff) | |
download | itools-d7177f246e63afb2777eb8418cc4e5e3c17e9698.tar.gz itools-d7177f246e63afb2777eb8418cc4e5e3c17e9698.tar.bz2 itools-d7177f246e63afb2777eb8418cc4e5e3c17e9698.zip |
Streamline dumping of debug info
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/it_debug.class b/it_debug.class index 61b4889..5069185 100644 --- a/it_debug.class +++ b/it_debug.class @@ -127,11 +127,17 @@ function dump($args) return "$r\n"; } -function backtrace() +function backtrace($skip = 0) { - foreach (array_slice(debug_backtrace(), 1) as $call) - $line .= basename($call['file']) . ":" . $call['line'] . " "; - return $line; + $result = array(); + + foreach (array_slice(debug_backtrace(), $skip + 1) as $call) + { + if ($call['file']) + $result[] = basename($call['file']) . ":" . $call['line']; + } + + return join(" ", $result); } } |