Remove debug globals (#12811)

* Remove $debug global
and $vdebug global
makes these variables more accessible and protects from collisions.

* the on boot set sends application as the first parameter, just handle that

* Relocate other debug related functions

* Log debug to stdout

* Wrong output

* remove stupid constants

* Fix lint and style issues
This commit is contained in:
Tony Murray
2021-04-29 22:42:18 -05:00
committed by GitHub
parent 2cdd762656
commit 61c89794e4
51 changed files with 287 additions and 278 deletions

View File

@@ -81,7 +81,7 @@ if ($error_msg) {
Rrd::graph($graphfile, $rrd_options);
d_echo($rrd_cmd);
if (is_file($graphfile)) {
if (! $debug) {
if (! \LibreNMS\Util\Debug::isEnabled()) {
set_image_type();
if ($output === 'base64') {
$imagedata = file_get_contents($graphfile);

View File

@@ -3,7 +3,7 @@
if (is_numeric($vars['id'])) {
$acc = dbFetchRow('SELECT * FROM `mac_accounting` AS M, `ports` AS I, `devices` AS D WHERE M.ma_id = ? AND I.port_id = M.port_id AND I.device_id = D.device_id', [$vars['id']]);
if ($debug) {
if (\LibreNMS\Util\Debug::isEnabled()) {
echo '<pre>';
print_r($acc);
echo '</pre>';