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

@@ -3,6 +3,7 @@
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Util\Debug;
$install_dir = realpath(__DIR__ . '/..');
chdir($install_dir);
@@ -23,7 +24,7 @@ function print_help()
}
if (isset($options['d'])) {
$debug = true;
Debug::set();
}
if (isset($options['help'])) {
@@ -61,7 +62,7 @@ echo 'Full Polling: ';
Config::set('polling.selected_ports', false);
foreach ($devices as $index => $device) {
echo $device['device_id'] . ' ';
if (! $debug) {
if (! Debug::isEnabled()) {
ob_start();
}
@@ -76,7 +77,7 @@ Config::set('polling.selected_ports', true);
echo 'Selective Polling: ';
foreach ($devices as $index => $device) {
echo $device['device_id'] . ' ';
if (! $debug) {
if (! Debug::isEnabled()) {
ob_start();
}