output);
render(<<<'HTML'
INFO
Tailing application logs.
Press Ctrl+C to exit
HTML,
);
render(<<<'HTML'
Use -v|-vv to show more details
HTML,
);
$this->file = new File(storage_path('pail/'.uniqid().'.pail'));
$this->file->create();
$this->trap([SIGINT, SIGTERM], fn () => $this->file->destroy());
$options = Options::fromCommand($this);
assert($this->file instanceof File);
try {
$processFactory->run($this->file, $this->output, $this->laravel->basePath(), $options);
} catch (ProcessSignaledException $e) {
if (in_array($e->getSignal(), [SIGINT, SIGTERM], true)) {
$this->newLine();
}
} catch (ProcessTimedOutException $e) {
$this->components->info('Maximum execution time exceeded.');
} finally {
$this->file?->destroy();
}
}
/**
* Handles the object destruction.
*/
public function __destruct()
{
if ($this->file) {
$this->file->destroy();
}
}
}