parent
a4ffda699f
commit
2936dc0e55
|
@ -96,16 +96,11 @@ class ConsoleIO extends BaseIO
|
||||||
public function write($messages, $newline = true)
|
public function write($messages, $newline = true)
|
||||||
{
|
{
|
||||||
if (null !== $this->startTime) {
|
if (null !== $this->startTime) {
|
||||||
$messages = (array) $messages;
|
$memoryUsage = memory_get_usage() / 1024 / 1024;
|
||||||
$startTime = $this->startTime;
|
$timeSpent = microtime(true) - $this->startTime;
|
||||||
$messages = array_map(function ($message) use ($startTime) {
|
$messages = array_map(function ($message) use ($memoryUsage, $timeSpent) {
|
||||||
return sprintf(
|
return sprintf('[%.1fMB/%.2fs] %s', $memoryUsage, $timeSpent, $message);
|
||||||
'[%.1fMB/%.2fs] %s',
|
}, (array) $messages);
|
||||||
memory_get_usage() / 1024 / 1024,
|
|
||||||
microtime(true) - $startTime,
|
|
||||||
$message
|
|
||||||
);
|
|
||||||
}, $messages);
|
|
||||||
}
|
}
|
||||||
$this->output->write($messages, $newline);
|
$this->output->write($messages, $newline);
|
||||||
$this->lastMessage = join($newline ? "\n" : '', (array) $messages);
|
$this->lastMessage = join($newline ? "\n" : '', (array) $messages);
|
||||||
|
|
Loading…
Reference in New Issue