From 3ebdeb0cbab3c7bff384938f609a4f05d8c5af78 Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 22 Oct 2023 22:16:33 -0400 Subject: [PATCH] Fixed issue where progress bar is displayed in VERBOSE mode Added checks in the update method of the ConsoleProgressBar class to prevent it from displaying when log level is set to VERBOSE. This is to prevent cluttering the command-line interface with unnecessary information when running in VERBOSE mode. The changes also are reflected in the changelog. --- CHANGELOG.md | 1 + src/ncc/Utilities/ConsoleProgressBar.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba812a1..dbd7e4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This update introduces minor bug fixes. - Improve build efficiency by preventing duplicate merges - Updated file tracking in Runtime class - Fixed division by zero in ConsoleProgressBar + - Fixed issue where progress bar is displayed in VERBOSE mode ## [2.0.3] - 2023-10-17 diff --git a/src/ncc/Utilities/ConsoleProgressBar.php b/src/ncc/Utilities/ConsoleProgressBar.php index b98f781..bced3c1 100644 --- a/src/ncc/Utilities/ConsoleProgressBar.php +++ b/src/ncc/Utilities/ConsoleProgressBar.php @@ -25,6 +25,9 @@ namespace ncc\Utilities; + use ncc\CLI\Main; + use ncc\Enums\LogLevel; + class ConsoleProgressBar { /** @@ -286,6 +289,11 @@ */ public function update(): void { + if(Resolver::checkLogLevel(LogLevel::VERBOSE, Main::getLogLevel())) + { + return; + } + if($this->auto_end && $this->value >= $this->max_value) { print($this->renderInformation() . $this->renderProgressBar() . "\n");