Created
September 24, 2012 10:44
-
-
Save tott/3775415 to your computer and use it in GitHub Desktop.
mini backtrace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mini_backtrace( $log = true ) { | |
$trax = array(); | |
$trace = debug_backtrace(); | |
foreach ( $trace as $key => $trc ) { | |
$trax[$key] = '[' . $key . '] : ' . $trc['file'] . '::' . $trc['line'] . ' - ' . $trc['function']; | |
} | |
if ( true === $log ) | |
error_log( var_export( $trax, true ) ); | |
return $trax; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment