-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progressbar vs logger vs stdOutput #1097
Comments
Robo makes an effort to hide and re-show the progress bar when it writes other output; however, there is an existing bug when The progress bar should auto-disable when stdout is redirected. If it does not, you can turn it off via an option, |
My main problem is that sometimes a log entry or an StdOutput line or an StdError line are in the same line with the progress bar. A little bit messy and very difficult to read, and hard to follow what is going on. |
There may be other bugs in addition to the exec bug. Compare against
Sorry, my mistake. |
Also, in my experience, |
The simplified version of my command: public function myCmd(): CommandResult
{
$cb = $this->collectionBuilder();
$cb->addTask($this->taskFoo());
$result = $cb->run();
return CommandResult::data($result['my_list']);
} When I do nothing extra and I run this command:
The "\r" is a little bit surprising, because the running OS is openSUSE Tumbleweed (Linux). I assume it is related to the progressBar re-drawing. The stdOutput is the same with The progressBar is always there even with The progressBar is always there even with When I initialise the collection builder like this: $nullOutput = new NullOutput();
$nullLogger = new NullLogger();
$io = new ConsoleIO(Robo::input(), $nullOutput);
$progressBar = new ProgressBar($nullOutput, 0, 99999);
$progressIndicator = new ProgressIndicator($progressBar, $nullOutput);
$cb = $this->collectionBuilder($io);
$cb->setLogger($nullLogger);
$cb->setProgressIndicator($progressIndicator); Then the stdOutput is the expected. I think the progressBar manager for some operation uses the stdOutput instead of the stdError. |
When a a symfony progressBar receives the $output it checks that if it is a ConsoleOutputInterface or not, if it is, then uses the srdError part. \Robo\Common\ProgressIndicator does not do such a checking, just uses it directly. robo/src/Common/ProgressIndicator.php Line 59 in 1daaeae
robo/src/Common/ProgressIndicator.php Line 82 in 1daaeae
|
Steps to reproduce
Command:
./vendor/bin/robo --load-from='RoboFileDummy.php' -vv dummy:progressbar
Actual output:
Expected:
Command:
./vendor/bin/robo --load-from='RoboFileDummy.php' -vv dummy:progressbar 2>/dev/null
Actual output:
Expected output
Same as above but without the
$this->output()->writeln('stdOutput line 1');
lines.Command:
./vendor/bin/robo --load-from='RoboFileDummy.php' -vv dummy:progressbar 2>/dev/null
Actual output:
The output starts with an empty line.
Expected output
The leading empty line not just a blemish, because it can cause problem in certain use cases.
robo dummy:progressbar | xargs ...
Other progressbar related issues:
System Configuration
consolidation/robo 3.x
The text was updated successfully, but these errors were encountered: