PHP code example of trash-panda / progress-bar-log
1. Go to this page and download the library: Download trash-panda/progress-bar-log library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
trash-panda / progress-bar-log example snippets
use Psr\Log\LogLevel;
use TrashPanda\ProgressBarLog\ProgressBarLog;
st entries will be displayed - like a tail.
//The second parameter is the maximum number of steps for the progress bar
$progressLog = new ProgressBarLog(6, 10);
$progressLog->start();
//advance the progress bar by one
$progressLog->advance();
//Add a log line - the first parameter is a psr/log severity constant
//you can pass whatever you want there - but if it is a psr/log constant then the severity is colored accordingly
$progressLog->addLog(LogLevel::CRITICAL, 'Some mission critical error');
use TrashPanda\ProgressBarLog\ProgressBarLog;
og->getProgressBar()->setFormat('normal');
$progressLog->getProgressBar()->setBarWidth(50);
$progressLog->start();