From 9b17893b20720a8895a09c63cf6c257acda9693f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 20 Nov 2005 01:52:22 +0000 Subject: [PATCH] With _message() in debug mode, print the trace stack --- kernel.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel.php b/kernel.php index 5f5959c..16f3834 100644 --- a/kernel.php +++ b/kernel.php @@ -368,6 +368,7 @@ class Shared_Object_Framework * @param string The content of the message * @param integer Type of message to be printed * @param bool Return the output? + * @param bool Include the debug stack? * * @return mixed Output or null */ @@ -396,9 +397,17 @@ class Shared_Object_Framework break; } + if ($this->debug) + { + $backtrace = debug_backtrace(); + unset($backtrace[0]); + } + $output = "\n
\n"; $output .= "\n\n\t\n"; - $output .= "\n\n\t\n\n
$prefix: $title
$message
\n
\n"; + $output .= "\n\n\t$message\n"; + $output .= ($this->debug ? "\n\n\tDebug Stack:
" . print_r($backtrace, true) . "
\n" : ''); + $output .= "\n\n
\n"; if ($return) { -- 2.43.5