diff --git a/src/ncc/Utilities/HttpClient.php b/src/ncc/Utilities/HttpClient.php index 180cab3..d87ad98 100644 --- a/src/ncc/Utilities/HttpClient.php +++ b/src/ncc/Utilities/HttpClient.php @@ -4,6 +4,8 @@ use CurlHandle; use ncc\Abstracts\HttpRequestType; + use ncc\Abstracts\LogLevel; + use ncc\CLI\Main; use ncc\Exceptions\HttpException; use ncc\Objects\HttpRequest; use ncc\Objects\HttpResponse; @@ -176,8 +178,24 @@ */ public static function displayProgress($resource, $downloadSize, $downloaded, $uploadSize, $uploaded): void { - if ($downloadSize > 0) - Console::inlineProgressBar($downloaded, $downloadSize); + if(Main::getLogLevel() !== null) + { + switch(Main::getLogLevel()) + { + case LogLevel::Verbose: + case LogLevel::Debug: + case LogLevel::Silent: + Console::outVerbose(sprintf(' <= %s of %s bytes downloaded', $downloaded, $downloadSize)); + break; + + default: + if ($downloadSize > 0) + Console::inlineProgressBar($downloaded, $downloadSize); + break; + } + } + + } /**