diff options
author | Andrew Dolgov <[email protected]> | 2018-12-01 10:05:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-01 10:05:26 +0300 |
commit | 8d190d539b8c7aff3a6b2b24f03bdc1db6681b1b (patch) | |
tree | 159a50e15b2305dd4475bbe15d5a812067e76135 | |
parent | 523e1cb9e8142f329db80c01756d64f770a79a13 (diff) |
CLI tools: fix --quiet not working if --log is unset
-rw-r--r-- | classes/debug.php | 3 | ||||
-rwxr-xr-x | update.php | 6 | ||||
-rwxr-xr-x | update_daemon2.php | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/classes/debug.php b/classes/debug.php index 21b823c52..c62f0c9f5 100644 --- a/classes/debug.php +++ b/classes/debug.php @@ -1,5 +1,6 @@ <?php class Debug { + public static $LOG_DISABLED = -1; public static $LOG_NORMAL = 0; public static $LOG_VERBOSE = 1; public static $LOG_EXTENDED = 2; @@ -9,7 +10,7 @@ class Debug { private static $logfile = false; private static $loglevel = 0; - public static function set_logfile($logfile) { + public static function set_logfile($logfile) { Debug::$logfile = $logfile; } diff --git a/update.php b/update.php index 17eafe126..cddad0e8f 100755 --- a/update.php +++ b/update.php @@ -117,7 +117,6 @@ } Debug::set_enabled(true); - Debug::set_quiet(isset($options['quiet'])); if (isset($options["log-level"])) { Debug::set_loglevel((int)$options["log-level"]); @@ -126,6 +125,11 @@ if (isset($options["log"])) { Debug::set_logfile($options["log"]); Debug::log("Logging to " . $options["log"]); + Debug::set_quiet(isset($options['quiet'])); + } else { + if (isset($options['quiet'])) { + Debug::set_loglevel(Debug::$LOG_DISABLED); + } } if (!isset($options["daemon"])) { diff --git a/update_daemon2.php b/update_daemon2.php index 007d6286f..8d36db5f3 100755 --- a/update_daemon2.php +++ b/update_daemon2.php @@ -153,7 +153,6 @@ } Debug::set_enabled(true); - Debug::set_quiet(isset($options['quiet'])); if (isset($options["log-level"])) { Debug::set_loglevel((int)$options["log-level"]); @@ -162,6 +161,11 @@ if (isset($options["log"])) { Debug::set_logfile($options["log"]); Debug::log("Logging to " . $options["log"]); + Debug::set_quiet(isset($options['quiet'])); + } else { + if (isset($options['quiet'])) { + Debug::set_loglevel(Debug::$LOG_DISABLED); + } } if (isset($options["tasks"])) { |