Skip to content

Instantly share code, notes, and snippets.

@adicahyaludin
Last active August 31, 2022 02:56
Show Gist options
  • Save adicahyaludin/89a3bb6f7e1d52a164b5fda85982bf31 to your computer and use it in GitHub Desktop.
Save adicahyaludin/89a3bb6f7e1d52a164b5fda85982bf31 to your computer and use it in GitHub Desktop.
/**
* 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