Last active
August 31, 2022 02:56
-
-
Save adicahyaludin/89a3bb6f7e1d52a164b5fda85982bf31 to your computer and use it in GitHub Desktop.
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
/** | |
* Debug to query monitor | |
* @since 1.0.0 | |
* @return void | |
*/ | |
if ( !function_exists( '__debug' ) ) : | |
function __debug() { | |
$bt = debug_backtrace(); | |
$caller = array_shift($bt); | |
$args = [ | |
"file" => $caller["file"], | |
"line" => $caller["line"], | |
"args" => func_get_args() | |
]; | |
do_action('qm/info', $args); | |
} | |
endif; | |
/** | |
* Print debug | |
* @since 1.0.0 | |
* @return html | |
*/ | |
if ( !function_exists( '__print_debug' ) ) : | |
function __print_debug() { | |
$bt = debug_backtrace(); | |
$caller = array_shift($bt); | |
$args = [ | |
"file" => $caller["file"], | |
"line" => $caller["line"], | |
"args" => func_get_args() | |
]; | |
?><pre><?php print_r($args); ?></pre><?php | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment