diff --git a/src/BaseCompiler.php b/src/BaseCompiler.php index c121934..35dae9d 100644 --- a/src/BaseCompiler.php +++ b/src/BaseCompiler.php @@ -5,6 +5,7 @@ namespace Zoomyboy\Tex; use Illuminate\Contracts\Support\Responsable; use Illuminate\Http\File; use Illuminate\Support\Str; +use Log; abstract class BaseCompiler implements Responsable { @@ -26,6 +27,7 @@ abstract class BaseCompiler implements Responsable $this->refreshFile(); if (!$this->file->isFile()) { + Log::error('Compilation failed', ['body' => $contents, 'output' => $output, 'dir' => $this->file->getPath(), 'command' => $this->command($document)]); throw (new CompilerException('Compilation failed.'))->setOutput($output); } @@ -40,6 +42,11 @@ abstract class BaseCompiler implements Responsable ]); } + public function getPath(): string + { + return $this->file->getRealPath(); + } + protected function prepareForCompilation(Document $document): void { $workDir = '/tmp/'.Str::random(32);