Skip to content

Commit aef4bac

Browse files
committed
feat: save generated logs content
1 parent b703c3e commit aef4bac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/SQLLoader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class SQLLoader
3939

4040
protected bool $deleteFiles = false;
4141

42+
protected string $logs = '';
43+
4244
public function __construct(
4345
protected array $options = []
4446
) {
@@ -98,6 +100,8 @@ public function execute(): ProcessResult
98100

99101
$this->result = Process::command($command)->run();
100102

103+
$this->logs = file_get_contents($this->logPath) ?? '';
104+
101105
if ($this->deleteFiles) {
102106
$this->deleteGeneratedFiles();
103107
}
@@ -332,4 +336,9 @@ protected function deleteGeneratedFiles(): void
332336
$filesystem->delete($this->controlFile);
333337
}
334338
}
339+
340+
public function logs(): string
341+
{
342+
return $this->logs;
343+
}
335344
}

0 commit comments

Comments
 (0)