mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -8,6 +8,9 @@
|
||||
*
|
||||
* @copyright (C) 2006 - 2012 Adam Armstrong
|
||||
*/
|
||||
|
||||
use LibreNMS\Util\Debug;
|
||||
|
||||
$init_modules = ['discovery'];
|
||||
require __DIR__ . '/includes/init.php';
|
||||
|
||||
@@ -59,7 +62,7 @@ if (isset($options['i']) && $options['i'] && isset($options['n'])) {
|
||||
$doing = $options['n'] . '/' . $options['i'];
|
||||
}
|
||||
|
||||
if (set_debug(isset($options['d'])) || isset($options['v'])) {
|
||||
if (Debug::set(isset($options['d']), false) || isset($options['v'])) {
|
||||
$versions = version_info();
|
||||
echo <<<EOH
|
||||
===================================
|
||||
@@ -75,9 +78,7 @@ SNMP: {$versions['netsnmp_ver']}
|
||||
EOH;
|
||||
|
||||
echo "DEBUG!\n";
|
||||
if (isset($options['v'])) {
|
||||
$vdebug = true;
|
||||
}
|
||||
Debug::setVerbose(isset($options['v']));
|
||||
\LibreNMS\Util\OS::updateCache(true); // Force update of OS Cache
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user