Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BV Logger crit method issue #103

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/CurrentProductProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getProduct()
}
$this->currentProduct = $this->productRepository->getById($product->getId());
} catch (Exception $e) {
$this->bvLogger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->bvLogger->critical($e->getMessage()."\n".$e->getTraceAsString());

return false;
}
Expand Down
12 changes: 6 additions & 6 deletions Model/Feed/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function generateFeed()
break;
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
$this->logger->debug('End Bazaarvoice '.$this->typeId.' Feed Generation');
}
Expand Down Expand Up @@ -121,7 +121,7 @@ public function exportFeedByStoreGroup()
'Failed to export daily '.$this->typeId.' feed for store group: '
.$storeGroup->getName()
);
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand All @@ -143,7 +143,7 @@ public function exportFeedByStore()
}
} catch (Exception $e) {
$this->logger->error('Failed to export daily '.$this->typeId.' feed for store: '.$store->getCode());
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand All @@ -164,7 +164,7 @@ public function exportFeedByWebsite()
}
} catch (Exception $e) {
$this->logger->error('Failed to export daily '.$this->typeId.' feed for website: '.$website->getName());
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand All @@ -181,7 +181,7 @@ public function exportFeedByGlobal()
}
} catch (Exception $e) {
$this->logger->error('Failed to export daily '.$this->typeId.' feed.');
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ protected function uploadFeed($sourceFile, $destinationFile, $store = null)
$ioObject->mv($sourceFile, $sentFile);
}
} catch (Exception $e) {
$this->logger->err($e->getMessage());
$this->logger->error($e->getMessage());
}
}
}
19 changes: 0 additions & 19 deletions Model/Filesystem/Io/Sftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,4 @@
*/
class Sftp extends \Magento\Framework\Filesystem\Io\Sftp
{
/**
* @var \phpseclib\Net\SFTP $_connection
*/
protected $_connection = null;

/**
* Fixes Magento 2.1 phpseclib notice.
*
* @param $filename
* @param $source
* @param null $mode
*
* @return mixed
*/
public function write($filename, $source, $mode = null)
{
$mode = is_readable($source) ? \phpseclib\Net\SFTP::SOURCE_LOCAL_FILE : \phpseclib\Net\SFTP::SOURCE_STRING;
return $this->_connection->put($filename, $source, $mode);
}
}
10 changes: 5 additions & 5 deletions Model/Indexer/Eav.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function executeFull()
$this->logger->debug(__('Bazaarvoice Product Feed Index is being rebuilt via cron.'));
$this->execute();
} catch (Exception $e) {
$this->logger->err($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->error($e->getMessage()."\n".$e->getTraceAsString());
}

return true;
Expand Down Expand Up @@ -255,7 +255,7 @@ public function execute($ids = [])
$this->logStats();
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}

return true;
Expand Down Expand Up @@ -718,7 +718,7 @@ private function populateIndexLocaleData($productIds, Store $store): void
}
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand Down Expand Up @@ -1091,10 +1091,10 @@ private function saveProductIndexes()
$existingIndex->addData($bvIndex->getData());
$this->indexRepository->save($existingIndex);
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Model/Indexer/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function executeFull()
$this->logger->debug(__('Bazaarvoice Product Feed Index is being rebuilt.'));
$this->execute();
} catch (Exception $e) {
$this->logger->err($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->error($e->getMessage()."\n".$e->getTraceAsString());
}

return true;
Expand Down Expand Up @@ -270,7 +270,7 @@ public function execute($ids = [])
$this->logStats();
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}

return true;
Expand Down Expand Up @@ -574,7 +574,7 @@ private function populateIndexStoreData($productIds, $store)
try {
$rows = $select->query();
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
if (strpos($e->getMessage(), 'Column not found') !== false) {
$errorExplanation = 'The following "Column not found" error typically results from a product attribute missing from the flat product table. Please ensure that the attribute referenced in the error is set to Use In Product Listing = Yes, which should cause a reindex to add it to the product flat table that is being queried: ' . $e->getMessage();
throw new Exception($errorExplanation, 0, $e);
Expand Down Expand Up @@ -795,7 +795,7 @@ private function populateIndexLocaleData($productIds, $store)
}
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand Down Expand Up @@ -1142,10 +1142,10 @@ private function saveProductIndexes()
$existingIndex->addData($bvIndex->getData());
$this->indexRepository->save($existingIndex);
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
} catch (Exception $e) {
$this->logger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->logger->critical($e->getMessage()."\n".$e->getTraceAsString());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ViewModel/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function isConfigurable()
return $this->getProduct()->getTypeId() == Configurable::TYPE_CODE;
}
} catch (Exception $e) {
$this->bvLogger->crit($e->getMessage()."\n".$e->getTraceAsString());
$this->bvLogger->critical($e->getMessage()."\n".$e->getTraceAsString());
}

return false;
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": [
"MIT"
],
"version": "9.1.5",
"version": "9.1.6",
"autoload": {
"files": [
"registration.php"
Expand All @@ -15,6 +15,8 @@
}
},
"require": {
"php": "~7.0||~8.1.0" ,"magento/framework": "~100.1|~101.0|~102.0|~103.0|~104.0"
"php": "~7.0||~8.1.0" ,
"magento/framework": "~100.1|~101.0|~102.0|~103.0|~104.0",
"monolog/monolog": "*"
}
}