diff --git a/src/Dennis/Link/Checker/Link.php b/src/Dennis/Link/Checker/Link.php index 7a27d04..d4875ab 100644 --- a/src/Dennis/Link/Checker/Link.php +++ b/src/Dennis/Link/Checker/Link.php @@ -266,7 +266,7 @@ public function redirectsToTerm() { } } else { // Alias entity type can not be established. - $this->getConfig()->getLogger()->warning('Unable to load determine the entity type from Drupal path @internal_path. ', ['@internal_path' => $internal_path]); + $this->getConfig()->getLogger()->warning('Warning: Unable to determine the entity type from Drupal path @internal_path. ', ['@internal_path' => $internal_path]); } } } diff --git a/src/Dennis/Link/Checker/Processor.php b/src/Dennis/Link/Checker/Processor.php index 0622ae3..090c9e6 100644 --- a/src/Dennis/Link/Checker/Processor.php +++ b/src/Dennis/Link/Checker/Processor.php @@ -153,7 +153,7 @@ public function __construct( public function run() { // Prevent processing of links when site is in maintenance mode. if ($this->inMaintenanceMode()) { - $this->getConfig()->getLogger()->info('Links cannot be processed when the site is in maintenance mode.'); + $this->getConfig()->getLogger()->info('Info: Links cannot be processed when the site is in maintenance mode.'); return FALSE; } @@ -172,7 +172,7 @@ public function run() { $ok_to_continue = $this->doNextItem(); } catch (RequestTimeoutException $e) { // Don't try to process any more items for this run. - $this->getConfig()->getLogger()->warning('Error: @error', ['@error' => $e->getMessage()]); + $this->getConfig()->getLogger()->warning('Warning: error @error encountered.', ['@error' => $e->getMessage()]); return FALSE; } } @@ -408,7 +408,7 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { } catch (TimeoutException $e) { // Log timeout and stop processing this item so that it gets deleted from the queue. - $this->getConfig()->getLogger()->warning('Error: @error - entity type: @entity_type - entity ID: @entity_id', [ + $this->getConfig()->getLogger()->warning('Warning: error @error encountered - entity type: @entity_type - entity ID: @entity_id', [ '@error' => $e->getMessage(), '@entity_type' => $item->entityType(), '@entity_id' => $item->entityId(), @@ -426,7 +426,7 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { if ($error = $link->getError()) { if ($link->getNumberOfRedirects() > $this->getConfig()->getMaxRedirects()) { - $this->getConfig()->getLogger()->warning('Excessive Redirects on entity type: @entity_type - entity ID: @entity_id', [ + $this->getConfig()->getLogger()->warning('Warning: Excessive Redirects on entity type: @entity_type - entity ID: @entity_id', [ '@entity_type' => $item->entityType(), '@entity_id' => $item->entityId(), ]); @@ -434,7 +434,7 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { $this->getAnalyzer()->updateStatistics('redirect_loops_found', ['node' => $item->entityId(), 'link' => $link->getData()]); } else { - $this->getConfig()->getLogger()->error('Error @error when visiting @link.', [ + $this->getConfig()->getLogger()->error('Error: @error when visiting @link.', [ '@error' => $error, '@link' => $link->originalHref(), ]); @@ -443,7 +443,7 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { } } else { - $this->getConfig()->getLogger()->debug('Processed link: entity type: @entity_type - entity ID: @entity_id - # of redirects: @redirects_count - original URL: @original_href.', [ + $this->getConfig()->getLogger()->debug('Debug: Processed link: entity type: @entity_type - entity ID: @entity_id - # of redirects: @redirects_count - original URL: @original_href.', [ '@entity_type' => $entity->entityType(), '@entity_id' => $entity->entityId(), '@redirects_count' => $link->getNumberOfRedirects(), @@ -457,7 +457,7 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { $this->getAnalyzer()->updateStatistics('404s_found', ['node' => $item->entityId(), 'link' => $link->getData(), 'suggestedLink' => $suggested]); - $this->getConfig()->getLogger()->error('Page not found error: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - suggested URL: @suggested_href.', [ + $this->getConfig()->getLogger()->error('Error: Page not found: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - suggested URL: @suggested_href.', [ '@entity_type' => $entity->entityType(), '@entity_id' => $entity->entityId(), '@original_href' => $link->originalHref(), @@ -469,12 +469,6 @@ public function correctLinks(ItemInterface $item, FieldInterface $field) { if ($link->corrected() && $this->updateLink($entity, $link)) { $do_field_save = TRUE; $this->getAnalyzer()->updateStatistics('links_updated', ['node' => $item->entityId(), 'link' => $link->getData()]); - - $this->getConfig()->getLogger()->debug('Link updated: entity type: @entity_type - entity ID: @entity_id - # of redirects: @redirects_count - link data: @link_data.', [ - '@entity_type' => $entity->entityType(), - '@entity_id' => $entity->entityId(), - '@link_data' => implode(' | ', $link->getData()), - ]); } else { $this->getAnalyzer()->updateStatistics('links_not_updated', ['node' => $item->entityId(), 'link' => $link->getData()]); @@ -506,7 +500,7 @@ public function updateLink(EntityInterface $entity, LinkInterface $link) { // Strip link and keep the text part $link->strip(); - $this->getConfig()->getLogger()->info('Link removed: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - changed to: @corrected_href.', [ + $this->getConfig()->getLogger()->info('Info: Link removed: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - changed to: @corrected_href.', [ '@entity_type' => $entity->entityType(), '@entity_id' => $entity->entityId(), '@original_href' => $link->originalHref(), @@ -517,7 +511,7 @@ public function updateLink(EntityInterface $entity, LinkInterface $link) { } else { if ($link->replace()) { - $this->getConfig()->getLogger()->info('Link updated: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - changed to: @corrected_href.', [ + $this->getConfig()->getLogger()->info('Info: Link corrected (updated): entity type: @entity_type - entity ID: @entity_id - original URL: @original_href - changed to: @corrected_href.', [ '@entity_type' => $entity->entityType(), '@entity_id' => $entity->entityId(), '@original_href' => $link->originalHref(), @@ -527,7 +521,7 @@ public function updateLink(EntityInterface $entity, LinkInterface $link) { $this->getAnalyzer()->updateStatistics('links_updated', ['node' => $entity->entityId(), 'link' => $link->getData()]); } else { - $this->getConfig()->getLogger()->info('Link not changed: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href.', [ + $this->getConfig()->getLogger()->info('Info: Link not corrected: entity type: @entity_type - entity ID: @entity_id - original URL: @original_href.', [ '@entity_type' => $entity->entityType(), '@entity_id' => $entity->entityId(), '@original_href' => $link->originalHref(),