added switch on off for server console log
This commit is contained in:
14
plugins/wp_model_plugin/utils/console_log.php
Normal file
14
plugins/wp_model_plugin/utils/console_log.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// https://stackify.com/how-to-log-to-console-in-php/
|
||||
|
||||
function console_log($output) {
|
||||
global $CONSOLE_OFF;
|
||||
if ($CONSOLE_OFF)
|
||||
return;
|
||||
$json_output = json_encode($output, JSON_HEX_TAG);
|
||||
$js_code = '<script>console.log(' . $json_output . ');</script>';
|
||||
echo $js_code;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user