Skip to content

Commit ee7a38d

Browse files
authored
Pass output to the logger factory (#156)
1 parent e2e4522 commit ee7a38d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/ParallelCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ final protected function execute(InputInterface $input, OutputInterface $output)
9494
Closure::fromCallable([$this, 'getItemName']),
9595
$commandName,
9696
$this->getDefinition(),
97-
$this->createErrorHandler(),
97+
$this->createErrorHandler($output),
9898
)
9999
->build()
100100
->execute(
@@ -128,7 +128,7 @@ protected function getParallelExecutableFactory(
128128
);
129129
}
130130

131-
protected function createErrorHandler(): ErrorHandler
131+
protected function createErrorHandler(OutputInterface $output): ErrorHandler
132132
{
133133
return new LoggingErrorHandler(
134134
new ThrowableCodeErrorHandler(

src/Parallelization.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
135135
fn (int $count) => $this->getItemName($count),
136136
$this->getName(),
137137
$this->getDefinition(),
138-
$this->createErrorHandler(),
138+
$this->createErrorHandler($output),
139139
)
140140
->build()
141141
->execute(
@@ -265,8 +265,7 @@ protected function getParallelExecutableFactory(
265265
->withRunAfterBatch(Closure::fromCallable([$this, 'runAfterBatch']));
266266
}
267267

268-
// TODO: probably worth passing the output here in case
269-
protected function createErrorHandler(): ErrorHandler
268+
protected function createErrorHandler(OutputInterface $output): ErrorHandler
270269
{
271270
$errorHandler = new ThrowableCodeErrorHandler(
272271
ResetServiceErrorHandler::forContainer($this->getContainer()),

0 commit comments

Comments
 (0)