Skip to content

Commit

Permalink
Better output. More readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Mar 20, 2016
1 parent a440072 commit 1476ab9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Executor/Informer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(OutputWatcher $output)
public function startTask($taskName)
{
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
$this->output->writeln("➤ Executing task $taskName");
$this->output->writeln("➤ Executing task <info>$taskName</info>");
$this->output->setWasWritten(false);
$this->startTime = round(microtime(true) * 1000);
}
Expand Down Expand Up @@ -69,7 +69,7 @@ public function endTask()
public function onServer($serverName)
{
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$this->output->writeln(" on [$serverName]");
$this->output->writeln(" on [$serverName]");
}
}

Expand All @@ -79,7 +79,7 @@ public function onServer($serverName)
public function endOnServer($serverName)
{
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$this->output->writeln("<info></info> done on [$serverName]");
$this->output->writeln("<info></info> done on [$serverName]");
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ function run($command)
}

if (isVeryVerbose()) {
writeln("<comment>Run</comment>: $command");
writeln("<fg=red>></fg=red> $command");
}

$output = $server->run($command);

if (isDebug() && !empty($output)) {
writeln(array_map(function ($line) {
return "<fg=red>></fg=red> $line";
}, explode("\n", $output)));
output()->writeln(array_map(function ($line) {
return "\033[1;30m< $line\033[0m";
}, explode("\n", $output)), OutputInterface::OUTPUT_RAW);
}

return new Result($output);
Expand Down

0 comments on commit 1476ab9

Please sign in to comment.