From a21710e9de5f36491de52c86872188bf5bf46c8b Mon Sep 17 00:00:00 2001 From: Nicolas MELONI Date: Fri, 6 Dec 2024 15:16:16 +0100 Subject: [PATCH] Changed logger verbosity --- .../Attribute/ProductAttributeValueValueBuilder.php | 2 +- .../TaxonAttribute/TaxonAttributeValueBuilder.php | 2 +- src/Checker/Product/IsProductProcessableChecker.php | 4 ++-- src/Command/AbstractImportCommand.php | 2 +- src/Command/BatchImportAssetsCommand.php | 2 +- src/Command/BatchImportAssociationTypesCommand.php | 2 +- src/Command/BatchImportAttributesCommand.php | 2 +- src/Command/BatchImportCategoriesCommand.php | 2 +- src/Command/BatchImportProductModelsCommand.php | 2 +- src/Command/BatchImportProductsCommand.php | 2 +- src/Command/ImportAssociationsCommand.php | 4 ++-- src/Handler/Task/SymfonyMessengerTaskHandler.php | 4 ++-- src/Handler/Task/SymfonyProcessTaskHandler.php | 10 +++++----- .../AssetProductAttributeProcessor.php | 10 +++++----- .../Resource/Product/ProductModelResourceProcessor.php | 9 ++------- .../Asset/AssetAttributeTypeMatcherProvider.php | 2 +- src/Provider/Asset/AssetValueBuilderProvider.php | 4 ++-- src/Provider/Filter/SearchFilterProvider.php | 2 +- src/Provider/Handler/Task/TaskHandlerProvider.php | 2 +- src/Task/Asset/BatchAssetTask.php | 2 +- src/Task/Asset/ProcessAssetTask.php | 2 +- src/Task/Association/AssociateProductsTask.php | 8 ++++---- src/Task/AssociationType/BatchAssociationTypesTask.php | 2 +- src/Task/Attribute/BatchAttributesTask.php | 2 +- src/Task/Attribute/RetrieveAttributesTask.php | 4 ++-- src/Task/Category/BatchCategoriesTask.php | 2 +- src/Task/Category/ProcessCategoriesTask.php | 3 +-- src/Task/Product/ProcessProductsTask.php | 2 +- src/Task/ProductGroup/ProcessProductGroupModelTask.php | 4 ++-- src/Task/ProductModel/ProcessProductModelsTask.php | 2 +- src/TypeMatcher/Attribute/AttributeTypeMatcher.php | 2 +- 31 files changed, 49 insertions(+), 55 deletions(-) diff --git a/src/Builder/Attribute/ProductAttributeValueValueBuilder.php b/src/Builder/Attribute/ProductAttributeValueValueBuilder.php index 26d8a770..28c50258 100644 --- a/src/Builder/Attribute/ProductAttributeValueValueBuilder.php +++ b/src/Builder/Attribute/ProductAttributeValueValueBuilder.php @@ -59,7 +59,7 @@ public function hasSupportedBuilder(string $attributeCode): bool return true; } } catch (Throwable $throwable) { - $this->akeneoLogger->critical(sprintf( + $this->akeneoLogger->error(sprintf( 'AttributeValueBuilder "%s" failed to execute method support() for attribute "%s"', $attributeValueBuilder::class, $attributeCode, diff --git a/src/Builder/TaxonAttribute/TaxonAttributeValueBuilder.php b/src/Builder/TaxonAttribute/TaxonAttributeValueBuilder.php index 3c867381..58750be2 100644 --- a/src/Builder/TaxonAttribute/TaxonAttributeValueBuilder.php +++ b/src/Builder/TaxonAttribute/TaxonAttributeValueBuilder.php @@ -60,7 +60,7 @@ public function hasSupportedBuilder(string $attributeCode): bool return true; } } catch (Throwable $throwable) { - $this->akeneoLogger->critical(sprintf( + $this->akeneoLogger->error(sprintf( 'TaxonAttributeValueBuilder "%s" failed to execute method support() for attribute "%s"', $attributeValueBuilder::class, $attributeCode, diff --git a/src/Checker/Product/IsProductProcessableChecker.php b/src/Checker/Product/IsProductProcessableChecker.php index 48156a91..a7fdc2db 100644 --- a/src/Checker/Product/IsProductProcessableChecker.php +++ b/src/Checker/Product/IsProductProcessableChecker.php @@ -25,13 +25,13 @@ public function check(array $resource): bool { try { if ('' === $resource['code'] || null === $resource['code']) { - $this->akeneoLogger->warning('Skipping product import because the code is missing.', ['resource' => $resource]); + $this->akeneoLogger->debug('Skipping product import because the code is missing.', ['resource' => $resource]); return false; } if (!isset($resource['family'])) { - $this->akeneoLogger->warning('Skipping product import because the family is missing.', ['resource' => $resource]); + $this->akeneoLogger->debug('Skipping product import because the family is missing.', ['resource' => $resource]); return false; } diff --git a/src/Command/AbstractImportCommand.php b/src/Command/AbstractImportCommand.php index 4219b97f..6a09d037 100644 --- a/src/Command/AbstractImportCommand.php +++ b/src/Command/AbstractImportCommand.php @@ -52,7 +52,7 @@ protected function preExecute(): void throw new CommandLockedException(Messages::commandAlreadyRunning()); } - $this->akeneoLogger->notice($this->getName() ?? ''); + $this->akeneoLogger->debug($this->getName() ?? ''); $this->pipeline = $this->pipelineFactory->create(); } diff --git a/src/Command/BatchImportAssetsCommand.php b/src/Command/BatchImportAssetsCommand.php index 5bd59ab2..8b930a80 100644 --- a/src/Command/BatchImportAssetsCommand.php +++ b/src/Command/BatchImportAssetsCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $batchPayload = new AssetPayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/BatchImportAssociationTypesCommand.php b/src/Command/BatchImportAssociationTypesCommand.php index 88cff44f..8450fd87 100644 --- a/src/Command/BatchImportAssociationTypesCommand.php +++ b/src/Command/BatchImportAssociationTypesCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $batchPayload = new AssociationTypePayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/BatchImportAttributesCommand.php b/src/Command/BatchImportAttributesCommand.php index 3ba48076..8e3aa395 100644 --- a/src/Command/BatchImportAttributesCommand.php +++ b/src/Command/BatchImportAttributesCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $attributePayload = new AttributePayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/BatchImportCategoriesCommand.php b/src/Command/BatchImportCategoriesCommand.php index 8ad6104e..5760c2ae 100644 --- a/src/Command/BatchImportCategoriesCommand.php +++ b/src/Command/BatchImportCategoriesCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $payload = new CategoryPayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/BatchImportProductModelsCommand.php b/src/Command/BatchImportProductModelsCommand.php index 3aef4ec6..09f1a36c 100644 --- a/src/Command/BatchImportProductModelsCommand.php +++ b/src/Command/BatchImportProductModelsCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $productModelPayload = new ProductModelPayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/BatchImportProductsCommand.php b/src/Command/BatchImportProductsCommand.php index 6c168b95..057eb612 100644 --- a/src/Command/BatchImportProductsCommand.php +++ b/src/Command/BatchImportProductsCommand.php @@ -38,7 +38,7 @@ protected function execute( Assert::string($input->getArgument('ids')); $ids = explode(',', $input->getArgument('ids')); - $this->akeneoLogger->notice('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Processing batch', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->akeneoLogger->debug($this->getName() ?? '', ['batched_ids' => $ids]); $productModelPayload = new ProductPayload($this->clientFactory->createFromApiCredentials()); diff --git a/src/Command/ImportAssociationsCommand.php b/src/Command/ImportAssociationsCommand.php index 1192f6aa..40ba8331 100644 --- a/src/Command/ImportAssociationsCommand.php +++ b/src/Command/ImportAssociationsCommand.php @@ -44,12 +44,12 @@ protected function execute( return 0; } - $this->akeneoLogger->notice($this->getName() ?? ''); + $this->akeneoLogger->debug($this->getName() ?? ''); $payload = new AssociationPayload($this->clientFactory->createFromApiCredentials()); $this->associateProductsTask->__invoke($payload); - $this->akeneoLogger->notice(Messages::endOfCommand($this->getName() ?? '')); + $this->akeneoLogger->debug(Messages::endOfCommand($this->getName() ?? '')); $this->release(); return Command::SUCCESS; diff --git a/src/Handler/Task/SymfonyMessengerTaskHandler.php b/src/Handler/Task/SymfonyMessengerTaskHandler.php index 97ceeab0..5ff550fe 100644 --- a/src/Handler/Task/SymfonyMessengerTaskHandler.php +++ b/src/Handler/Task/SymfonyMessengerTaskHandler.php @@ -65,7 +65,7 @@ private function handleByPage( $identifiers[] = $item['code'] ?? $item['identifier']; if (0 === $count % $payload->getBatchSize()) { - $this->akeneoLogger->notice('Batching', ['codes' => $identifiers]); + $this->akeneoLogger->debug('Batching', ['codes' => $identifiers]); $this->batch($payload, $items); $items = []; $identifiers = []; @@ -96,7 +96,7 @@ private function handleByCursor( $identifiers[] = $item['code'] ?? $item['identifier']; if (0 === $count % $payload->getBatchSize()) { - $this->akeneoLogger->notice('Batching', ['codes' => $identifiers]); + $this->akeneoLogger->debug('Batching', ['codes' => $identifiers]); $this->batch($payload, $items); $items = []; $identifiers = []; diff --git a/src/Handler/Task/SymfonyProcessTaskHandler.php b/src/Handler/Task/SymfonyProcessTaskHandler.php index eb3da915..04686054 100644 --- a/src/Handler/Task/SymfonyProcessTaskHandler.php +++ b/src/Handler/Task/SymfonyProcessTaskHandler.php @@ -61,7 +61,7 @@ public function batch( $isTtySupported = Process::isTtySupported(); $process->setTty($isTtySupported); $this->processManager->addProcess($process); - $this->akeneoLogger->info('Added batch process', [ + $this->akeneoLogger->debug('Added batch process', [ 'ids' => $ids, ]); @@ -128,7 +128,7 @@ public function handle( } if ($count > 0 && count($ids) > 0 && $pipelinePayload->isBatchingAllowed() && $pipelinePayload->getProcessAsSoonAsPossible() && $pipelinePayload->allowParallel()) { - $this->akeneoLogger->notice('Batching', ['from_id' => $ids[0], 'to_id' => $ids[(is_countable($ids) ? \count($ids) : 0) - 1]]); + $this->akeneoLogger->debug('Batching', ['from_id' => $ids[0], 'to_id' => $ids[(is_countable($ids) ? \count($ids) : 0) - 1]]); $this->batch($pipelinePayload, $ids); $this->processManager->waitForAllProcesses(); @@ -184,7 +184,7 @@ private function handleByPage( if ($payload->isBatchingAllowed() && $payload->getProcessAsSoonAsPossible() && 0 === $count % $payload->getBatchSize()) { - $this->akeneoLogger->notice('Batching', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Batching', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->batch($payload, $ids); $ids = []; } @@ -201,7 +201,7 @@ private function handleByCursor( array &$ids = [], ): void { foreach ($resourceCursor as $item) { - $this->akeneoLogger->info('Processing item ' . ($item['identifier'] ?? $item['code'])); + $this->akeneoLogger->debug('Processing item ' . ($item['identifier'] ?? $item['code'])); ++$count; $sql = sprintf( 'INSERT INTO `%s` (`values`) VALUES (:values);', @@ -216,7 +216,7 @@ private function handleByCursor( if ($payload->isBatchingAllowed() && $payload->getProcessAsSoonAsPossible() && 0 === $count % $payload->getBatchSize()) { - $this->akeneoLogger->notice('Batching', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); + $this->akeneoLogger->debug('Batching', ['from_id' => $ids[0], 'to_id' => $ids[\count($ids) - 1]]); $this->batch($payload, $ids); $ids = []; } diff --git a/src/Processor/ProductAttribute/AssetProductAttributeProcessor.php b/src/Processor/ProductAttribute/AssetProductAttributeProcessor.php index fef94127..4ff92f3c 100644 --- a/src/Processor/ProductAttribute/AssetProductAttributeProcessor.php +++ b/src/Processor/ProductAttribute/AssetProductAttributeProcessor.php @@ -121,7 +121,7 @@ private function handleAsset( ); if (!$asset instanceof Asset) { - $this->akeneoLogger->info('Created asset for product', [ + $this->akeneoLogger->debug('Created asset for product', [ 'product' => $model->getCode(), 'familyCode' => $assetFamilyCode, 'attributeCode' => $attributeCode, @@ -156,7 +156,7 @@ private function handleAsset( $oldContent = $asset->getContent(); if ($oldContent === $data) { - $this->akeneoLogger->info('Skipped asset for product as it has same content', [ + $this->akeneoLogger->debug('Skipped asset for product as it has same content', [ 'product' => $model->getCode(), 'familyCode' => $assetFamilyCode, 'attributeCode' => $attributeCode, @@ -189,7 +189,7 @@ private function handleAsset( $data, ); - $this->akeneoLogger->info('Updated asset for product', [ + $this->akeneoLogger->debug('Updated asset for product', [ 'product' => $model->getCode(), 'familyCode' => $assetFamilyCode, 'attributeCode' => $attributeCode, @@ -228,7 +228,7 @@ private function addAssetToProduct( } if ($model->getAssets()->contains($asset)) { - $this->akeneoLogger->info('Asset already associated to product', [ + $this->akeneoLogger->debug('Asset already associated to product', [ 'product' => $model->getCode(), 'familyCode' => $assetFamilyCode, 'attributeCode' => $attributeCode, @@ -242,7 +242,7 @@ private function addAssetToProduct( $model->addAsset($asset); - $this->akeneoLogger->info('Associated asset to product', [ + $this->akeneoLogger->debug('Associated asset to product', [ 'product' => $model->getCode(), 'familyCode' => $assetFamilyCode, 'attributeCode' => $attributeCode, diff --git a/src/Processor/Resource/Product/ProductModelResourceProcessor.php b/src/Processor/Resource/Product/ProductModelResourceProcessor.php index 66f01426..d534865e 100644 --- a/src/Processor/Resource/Product/ProductModelResourceProcessor.php +++ b/src/Processor/Resource/Product/ProductModelResourceProcessor.php @@ -15,7 +15,6 @@ use Synolia\SyliusAkeneoPlugin\Checker\Product\IsProductProcessableCheckerInterface; use Synolia\SyliusAkeneoPlugin\Event\Product\AfterProcessingProductEvent; use Synolia\SyliusAkeneoPlugin\Event\Product\BeforeProcessingProductEvent; -use Synolia\SyliusAkeneoPlugin\Logger\Messages; use Synolia\SyliusAkeneoPlugin\Processor\Product\ProductProcessorChainInterface; use Synolia\SyliusAkeneoPlugin\Processor\ProductGroup\ProductGroupProcessor; use Synolia\SyliusAkeneoPlugin\Processor\Resource\AkeneoResourceProcessorInterface; @@ -51,7 +50,7 @@ public function process(array $resource): void } try { - $this->akeneoLogger->notice('Processing product', [ + $this->akeneoLogger->debug('Processing product', [ 'code' => $resource['code'] ?? $resource['identifier'] ?? 'unknown', ]); @@ -65,10 +64,6 @@ public function process(array $resource): void $product = $this->getOrCreateEntity($resource); $this->productProcessorChain->chain($product, $resource); - // TODO: check if id is null - $this->akeneoLogger->info(Messages::hasBeenCreated($product::class, (string) $product->getCode())); - $this->akeneoLogger->info(Messages::hasBeenUpdated($product::class, (string) $resource['code'])); - $this->dispatcher->dispatch(new AfterProcessingProductEvent($resource, $product)); $this->entityManager->flush(); } catch (ORMInvalidArgumentException $ormInvalidArgumentException) { @@ -104,7 +99,7 @@ private function handleProductGroup(array $resource): void $this->entityManager->flush(); } catch (ORMInvalidArgumentException $ormInvalidArgumentException) { if (!$this->entityManager->isOpen()) { - $this->akeneoLogger->warning('Recreating entity manager', ['exception' => $ormInvalidArgumentException]); + $this->akeneoLogger->error('Recreating entity manager', ['exception' => $ormInvalidArgumentException]); $this->entityManager = $this->getNewEntityManager(); } diff --git a/src/Provider/Asset/AssetAttributeTypeMatcherProvider.php b/src/Provider/Asset/AssetAttributeTypeMatcherProvider.php index e9295cd6..86b6a1e0 100644 --- a/src/Provider/Asset/AssetAttributeTypeMatcherProvider.php +++ b/src/Provider/Asset/AssetAttributeTypeMatcherProvider.php @@ -33,7 +33,7 @@ public function match(string $type): AssetAttributeTypeMatcherInterface return $typeMatcher; } } catch (\Throwable $throwable) { - $this->akeneoLogger->critical(\sprintf( + $this->akeneoLogger->error(\sprintf( 'AttributeTypeMatcher "%s" failed to execute method support() for attribute type "%s"', $typeMatcher::class, $type, diff --git a/src/Provider/Asset/AssetValueBuilderProvider.php b/src/Provider/Asset/AssetValueBuilderProvider.php index e1da5498..fb63226e 100644 --- a/src/Provider/Asset/AssetValueBuilderProvider.php +++ b/src/Provider/Asset/AssetValueBuilderProvider.php @@ -71,12 +71,12 @@ public function hasSupportedBuilder(string $assetFamilyCode, string $assetCode): return true; } } catch (UnsupportedAttributeTypeException $throwable) { - $this->akeneoLogger->info('Unsupported AssetAttributeType', [ + $this->akeneoLogger->warning('Unsupported AssetAttributeType', [ 'family_code' => $assetFamilyCode, 'asset_code' => $assetCode, ]); } catch (\Throwable $throwable) { - $this->akeneoLogger->critical(\sprintf( + $this->akeneoLogger->error(\sprintf( 'AssetValueBuilderInterface "%s" failed to execute method support() for asset "%s" in family "%s"', $attributeValueBuilder::class, $assetCode, diff --git a/src/Provider/Filter/SearchFilterProvider.php b/src/Provider/Filter/SearchFilterProvider.php index ef930406..f50a6c01 100644 --- a/src/Provider/Filter/SearchFilterProvider.php +++ b/src/Provider/Filter/SearchFilterProvider.php @@ -41,7 +41,7 @@ public function get(PayloadInterface $payload): array $queryParameters = array_merge_recursive($queryParameters, $payload->getCustomFilters()); - $this->akeneoLogger->notice('Filters', $queryParameters); + $this->akeneoLogger->debug('Filters', $queryParameters); return $queryParameters; } diff --git a/src/Provider/Handler/Task/TaskHandlerProvider.php b/src/Provider/Handler/Task/TaskHandlerProvider.php index 3f324b81..04cba1b6 100644 --- a/src/Provider/Handler/Task/TaskHandlerProvider.php +++ b/src/Provider/Handler/Task/TaskHandlerProvider.php @@ -25,7 +25,7 @@ public function provide(PipelinePayloadInterface $pipelinePayload): TaskHandlerI { foreach ($this->taskHandlers as $taskHandler) { if ($taskHandler->support($pipelinePayload)) { - $this->akeneoLogger->notice($taskHandler::class); + $this->akeneoLogger->debug($taskHandler::class); return $taskHandler; } diff --git a/src/Task/Asset/BatchAssetTask.php b/src/Task/Asset/BatchAssetTask.php index ff8e37f5..25e8ef78 100644 --- a/src/Task/Asset/BatchAssetTask.php +++ b/src/Task/Asset/BatchAssetTask.php @@ -42,7 +42,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->retrieveAssets($payload, $resource); $this->removeEntry($payload, (int) $result['id']); } catch (\Throwable $throwable) { - $this->akeneoLogger->warning($throwable->getMessage()); + $this->akeneoLogger->error($throwable->getMessage()); $this->removeEntry($payload, (int) $result['id']); } } diff --git a/src/Task/Asset/ProcessAssetTask.php b/src/Task/Asset/ProcessAssetTask.php index fd990c40..6ed35e7c 100644 --- a/src/Task/Asset/ProcessAssetTask.php +++ b/src/Task/Asset/ProcessAssetTask.php @@ -50,7 +50,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte return $payload; } - $this->akeneoLogger->notice(Messages::retrieveFromAPI($payload->getType())); + $this->akeneoLogger->debug(Messages::retrieveFromAPI($payload->getType())); $resources = $payload->getAkeneoPimClient()->getAssetFamilyApi()->all($this->searchFilterProvider->get($payload)); diff --git a/src/Task/Association/AssociateProductsTask.php b/src/Task/Association/AssociateProductsTask.php index 53145b3a..f47b7467 100644 --- a/src/Task/Association/AssociateProductsTask.php +++ b/src/Task/Association/AssociateProductsTask.php @@ -37,14 +37,14 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $productGroups = $this->productGroupRepository->findAll(); foreach ($productGroups as $productGroup) { - $this->akeneoLogger->info('Processing ProductGroup', [ + $this->akeneoLogger->debug('Processing ProductGroup', [ 'parent' => $productGroup->getModel(), ]); $parentModel = $this->productRepository->findOneBy(['code' => $productGroup->getModel()]); if (!$parentModel instanceof ProductInterface) { - $this->akeneoLogger->warning('Skipped ProductGroup', [ + $this->akeneoLogger->debug('Skipped ProductGroup', [ 'parent' => $productGroup->getModel(), ]); @@ -66,7 +66,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte /** @var ProductAssociationTypeInterface $productAssociationType */ $productAssociationType = $this->productAssociationTypeRepository->findOneBy(['code' => $associationType]); - $this->akeneoLogger->info('Processing ProductAssociationType', [ + $this->akeneoLogger->debug('Processing ProductAssociationType', [ 'code' => $associationType, 'name' => $productAssociationType->getName() ?? '', ]); @@ -127,7 +127,7 @@ private function retrieveModels( foreach ($associationProductGroup->getProducts() as $product) { $models[] = $product; - $this->akeneoLogger->info('Added product to association group', [ + $this->akeneoLogger->debug('Added product to association group', [ 'association_code' => $productAssociationType->getCode(), 'code' => $product->getCode(), ]); diff --git a/src/Task/AssociationType/BatchAssociationTypesTask.php b/src/Task/AssociationType/BatchAssociationTypesTask.php index 40abe699..b5017f95 100644 --- a/src/Task/AssociationType/BatchAssociationTypesTask.php +++ b/src/Task/AssociationType/BatchAssociationTypesTask.php @@ -34,7 +34,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte { $this->akeneoLogger->debug(self::class); $type = $payload->getType(); - $this->akeneoLogger->notice(Messages::createOrUpdate($type)); + $this->akeneoLogger->debug(Messages::createOrUpdate($type)); $query = $this->getSelectStatement($payload); /** @var Result $queryResult */ diff --git a/src/Task/Attribute/BatchAttributesTask.php b/src/Task/Attribute/BatchAttributesTask.php index 77aa7b5e..4889fab4 100644 --- a/src/Task/Attribute/BatchAttributesTask.php +++ b/src/Task/Attribute/BatchAttributesTask.php @@ -33,7 +33,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte { $this->akeneoLogger->debug(self::class); $type = $payload->getType(); - $this->akeneoLogger->notice(Messages::createOrUpdate($type)); + $this->akeneoLogger->debug(Messages::createOrUpdate($type)); $query = $this->getSelectStatement($payload); /** @var Result $queryResult */ diff --git a/src/Task/Attribute/RetrieveAttributesTask.php b/src/Task/Attribute/RetrieveAttributesTask.php index 58eb94db..9b1921be 100644 --- a/src/Task/Attribute/RetrieveAttributesTask.php +++ b/src/Task/Attribute/RetrieveAttributesTask.php @@ -25,7 +25,7 @@ public function __construct( public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInterface { $this->akeneoLogger->debug(self::class); - $this->akeneoLogger->notice(Messages::retrieveFromAPI($payload->getType())); + $this->akeneoLogger->debug(Messages::retrieveFromAPI($payload->getType())); $resources = $payload->getAkeneoPimClient()->getAttributeApi()->all( $this->apiConnectionProvider->get()->getPaginationSize(), ); @@ -39,7 +39,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->akeneoLogger->info(Messages::totalToImport($payload->getType(), $resources->key())); if ($noCodeCount > 0) { - $this->akeneoLogger->warning(Messages::noCodeToImport($payload->getType(), $noCodeCount)); + $this->akeneoLogger->info(Messages::noCodeToImport($payload->getType(), $noCodeCount)); } $payload = new AttributePayload($payload->getAkeneoPimClient()); diff --git a/src/Task/Category/BatchCategoriesTask.php b/src/Task/Category/BatchCategoriesTask.php index eb09f204..5d0b7ec1 100644 --- a/src/Task/Category/BatchCategoriesTask.php +++ b/src/Task/Category/BatchCategoriesTask.php @@ -33,7 +33,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte { $this->akeneoLogger->debug(self::class); $type = $payload->getType(); - $this->akeneoLogger->notice(Messages::createOrUpdate($type)); + $this->akeneoLogger->debug(Messages::createOrUpdate($type)); $query = $this->getSelectStatement($payload); /** @var Result $queryResult */ diff --git a/src/Task/Category/ProcessCategoriesTask.php b/src/Task/Category/ProcessCategoriesTask.php index 6c7efa05..ba128dd1 100644 --- a/src/Task/Category/ProcessCategoriesTask.php +++ b/src/Task/Category/ProcessCategoriesTask.php @@ -40,7 +40,7 @@ public function __construct( public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInterface { $this->akeneoLogger->debug(self::class); - $this->akeneoLogger->notice(Messages::retrieveFromAPI($payload->getType())); + $this->akeneoLogger->debug(Messages::retrieveFromAPI($payload->getType())); $resources = $payload->getAkeneoPimClient()->getCategoryApi()->all( $this->apiConnectionProvider->get()->getPaginationSize(), @@ -79,7 +79,6 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte } $this->akeneoLogger->info(Messages::totalExcludedFromImport($payload->getType(), \count($excludedCategories))); - $this->akeneoLogger->info(Messages::totalToImport($payload->getType(), \count($categories))); $payload->setResources($categories); diff --git a/src/Task/Product/ProcessProductsTask.php b/src/Task/Product/ProcessProductsTask.php index 324a3642..1dfc0060 100644 --- a/src/Task/Product/ProcessProductsTask.php +++ b/src/Task/Product/ProcessProductsTask.php @@ -42,7 +42,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte return $payload; } - $this->akeneoLogger->notice(Messages::retrieveFromAPI($payload->getType())); + $this->akeneoLogger->debug(Messages::retrieveFromAPI($payload->getType())); $resources = $payload->getAkeneoPimClient()->getProductApi()->all( $this->apiConnectionProvider->get()->getPaginationSize(), diff --git a/src/Task/ProductGroup/ProcessProductGroupModelTask.php b/src/Task/ProductGroup/ProcessProductGroupModelTask.php index 16d4ec7d..c4fe3d62 100644 --- a/src/Task/ProductGroup/ProcessProductGroupModelTask.php +++ b/src/Task/ProductGroup/ProcessProductGroupModelTask.php @@ -67,7 +67,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $this->productGroups[$productGroup->getModel()] = true; $productGroup->getProducts()->clear(); - $this->akeneoLogger->info('Cleaned ProductGroup associations', [ + $this->akeneoLogger->debug('Cleaned ProductGroup associations', [ 'product_code' => $product->getCode(), 'product_group_id' => $productGroup->getId(), 'family' => $productGroup->getFamily(), @@ -77,7 +77,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte $productGroup->addProduct($product); $this->entityManager->flush(); - $this->akeneoLogger->info('Added product to ProductGroup association', [ + $this->akeneoLogger->debug('Added product to ProductGroup association', [ 'product_code' => $product->getCode(), 'product_group_id' => $productGroup->getId(), 'family' => $productGroup->getFamily(), diff --git a/src/Task/ProductModel/ProcessProductModelsTask.php b/src/Task/ProductModel/ProcessProductModelsTask.php index 44e59b51..bd0d0f4b 100644 --- a/src/Task/ProductModel/ProcessProductModelsTask.php +++ b/src/Task/ProductModel/ProcessProductModelsTask.php @@ -45,7 +45,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte return $payload; } - $this->akeneoLogger->notice(Messages::retrieveFromAPI($payload->getType())); + $this->akeneoLogger->debug(Messages::retrieveFromAPI($payload->getType())); $resources = $payload->getAkeneoPimClient()->getProductModelApi()->all( $this->apiConnectionProvider->get()->getPaginationSize(), diff --git a/src/TypeMatcher/Attribute/AttributeTypeMatcher.php b/src/TypeMatcher/Attribute/AttributeTypeMatcher.php index dd5e3d3b..2f5b4585 100644 --- a/src/TypeMatcher/Attribute/AttributeTypeMatcher.php +++ b/src/TypeMatcher/Attribute/AttributeTypeMatcher.php @@ -31,7 +31,7 @@ public function match(string $type): AttributeTypeMatcherInterface return $typeMatcher; } } catch (Throwable $throwable) { - $this->akeneoLogger->critical(sprintf( + $this->akeneoLogger->error(sprintf( 'AttributeTypeMatcher "%s" failed to execute method support() for attribute type "%s"', $typeMatcher::class, $type,