Skip to content

Commit

Permalink
Removed console logger. Use stderr instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Jan 21, 2021
1 parent d3a857a commit 3fd791e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Console/Commands/RunMicroservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Console\Command;
use Butschster\Exchanger\Contracts\Exchange\Point;
use Butschster\Exchanger\Contracts\ExchangeManager;
use Butschster\Exchanger\Exchange\ConsoleLogger;

class RunMicroservice extends Command
{
Expand All @@ -14,9 +13,6 @@ class RunMicroservice extends Command

public function handle(ExchangeManager $exchange, Point $service)
{
$logger = new ConsoleLogger($this);
$exchange->setLogger($logger);

$exchange->register(
$service
);
Expand Down
6 changes: 6 additions & 0 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use NunoMaduro\Collision\Adapters\Laravel\Inspector;
use NunoMaduro\Collision\SolutionsRepositories\NullSolutionsRepository;
use NunoMaduro\Collision\Writer;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Exception\ExceptionInterface;
use Throwable;
use Butschster\Exchanger\Contracts\Exchange\IncomingRequest;
Expand All @@ -32,6 +33,11 @@ public function report(Throwable $e)
}

report($e);

$logger = $this->container->make(LoggerInterface::class);
if (method_exists($logger, 'handleException')) {
$logger->handleException($this, $e);
}
}

public function shouldReport(Throwable $e)
Expand Down

0 comments on commit 3fd791e

Please sign in to comment.