Skip to content

Commit

Permalink
Fix deployphp#3396. Displays the start timestamp to each task
Browse files Browse the repository at this point in the history
  • Loading branch information
HereticPilgrim committed Mar 2, 2023
1 parent fa2ce9a commit 0d7d96e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Executor/Messenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ public function startTask(Task $task): void
$this->output->writeln("::group::task {$task->getName()}");
} else if (getenv('GITLAB_CI')) {
$this->output->writeln("\e[0Ksection_start:{$this->startTime}:{$this->startTime}[collapsed=true]\r\e[0K{$task->getName()}");
} else if ($this->output->isVeryVerbose()) {
// option `-vv` displays task start time with milliseconds accuracy
$timestamp = (int) floor($this->startTime / 1000);
$millis = $this->startTime % 1000;

$taskStartTime = date("Y-d-m H:i:s", $timestamp);
$this->output->writeln("[{$taskStartTime}.{$millis}] <fg=cyan;options=bold>task</> {$task->getName()}");
} else if ($this->output->isVerbose()) {
// option `-v` displays task start time
$timestamp = (int) floor($this->startTime / 1000);

$taskStartTime = date("Y-d-m H:i:s", $timestamp);
$this->output->writeln("[{$taskStartTime}] <fg=cyan;options=bold>task</> {$task->getName()}");
} else {
$this->output->writeln("<fg=cyan;options=bold>task</> {$task->getName()}");
}
Expand Down

0 comments on commit 0d7d96e

Please sign in to comment.