Feat: Add logging
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Command;
|
||||
use App\BusProNet\DataProvider\HotelDataProvider;
|
||||
use App\BusProNet\DataProvider\PickupDataProvider;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@@ -22,6 +23,7 @@ class BpnImportCommand extends Command
|
||||
private readonly Connection $connection,
|
||||
private readonly HotelDataProvider $hotelDataProvider,
|
||||
private readonly PickupDataProvider $pickupDataProvider,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly string $xmlFilesPath
|
||||
) {
|
||||
parent::__construct();
|
||||
@@ -124,7 +126,9 @@ class BpnImportCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
$io->info('Added '.$addedCount.' and updated '.$updatedCount.' destinations');
|
||||
$logMessage = 'Added '.$addedCount.' and updated '.$updatedCount.' destinations';
|
||||
$io->info($logMessage);
|
||||
$this->logger->info($logMessage);
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user