From 72585c4e45f3573db45d6e202198b04dd0aa4100 Mon Sep 17 00:00:00 2001 From: Delirious Date: Thu, 22 Feb 2024 18:17:37 -0700 Subject: [PATCH] Update tools.php --- misc/tools.php | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/misc/tools.php b/misc/tools.php index e69c6b5..847d8e8 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -1,9 +1,16 @@ $trace) { + // Skip the first entry as it's the current function call + if ($index === 0) { + continue; + } + + // Build the log message for each stack frame + $logMessage .= "#{$index} "; + if (isset($trace['file'])) { + $logMessage .= "File: {$trace['file']} "; + } + if (isset($trace['line'])) { + $logMessage .= "Line: {$trace['line']} "; + } + if (isset($trace['function'])) { + $logMessage .= "Function: {$trace['function']} "; + } + $logMessage .= "\n"; + } + + // Log the stack trace to the error log + error_log($logMessage); + } + ?>