added switch on off for server console log

This commit is contained in:
asus
2024-02-08 16:42:16 +01:00
parent 373eee7fdb
commit c41b184221
14 changed files with 31 additions and 19 deletions

View 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;
}
?>