From c2ad65c29ad19bc091bc607e5fab8ba643ebf4b7 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 18 Dec 2014 14:52:05 +0200 Subject: [PATCH 01/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- .../Magento/Backend/Model/Menu/Config.php | 4 - app/code/Magento/Core/Model/Layout/Merge.php | 1 - .../Magento/Store/Model/StorageFactory.php | 33 --- composer.json | 3 +- .../Magento/TestFramework/ErrorLog/Logger.php | 6 +- .../Magento/Core/Model/Layout/MergeTest.php | 3 +- .../Magento/Framework/LoggerTest.php | 211 ------------------ .../Magento/Framework/Message/ManagerTest.php | 3 +- .../Store/Model/StorageFactoryTest.php | 18 +- .../Image/Adapter/AbstractAdapter.php | 1 - lib/internal/Magento/Framework/Logger.php | 97 +------- .../Magento/Framework/Message/Manager.php | 2 +- 12 files changed, 13 insertions(+), 369 deletions(-) delete mode 100644 dev/tests/unit/testsuite/Magento/Framework/LoggerTest.php diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index 0a023244a00a2..089f0e1315eb3 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -101,10 +101,6 @@ public function __construct( */ public function getMenu() { - if ($this->_scopeConfig->getValue('dev/log/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) { - $this->_logger->addStreamLog(\Magento\Backend\Model\Menu::LOGGER_KEY); - } - try { $this->_initMenu(); return $this->_menu; diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index d12c1a07b963d..b703560efd4a5 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -436,7 +436,6 @@ protected function _validateMergedLayout($cacheId, $layout) $messages = $this->_layoutValidator->getMessages(); //Add first message to exception $message = reset($messages); - $this->_logger->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM); $this->_logger->log('Cache file with merged layout: ' . $cacheId . ': ' . $message, \Zend_Log::ERR); } } diff --git a/app/code/Magento/Store/Model/StorageFactory.php b/app/code/Magento/Store/Model/StorageFactory.php index 053a718011087..e7473e2ba7c1a 100644 --- a/app/code/Magento/Store/Model/StorageFactory.php +++ b/app/code/Magento/Store/Model/StorageFactory.php @@ -63,7 +63,6 @@ class StorageFactory /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\Session\SidResolverInterface $sidResolver * @param \Magento\Framework\App\State $appState * @param \Magento\Framework\App\Http\Context $httpContext @@ -75,7 +74,6 @@ class StorageFactory public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Logger $logger, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\App\State $appState, \Magento\Framework\App\Http\Context $httpContext, @@ -87,7 +85,6 @@ public function __construct( $this->_objectManager = $objectManager; $this->_storageClassName = $storageClassName; $this->_eventManager = $eventManager; - $this->_log = $logger; $this->_appState = $appState; $this->_sidResolver = $sidResolver; $this->_writerModel = $writerModel; @@ -127,36 +124,6 @@ public function get(array $arguments = []) $this->_sidResolver->setUseSessionInUrl($useSid); $this->_eventManager->dispatch('core_app_init_current_store_after'); - - $store = $storage->getStore(true); - $logActive = $this->_scopeConfig->isSetFlag( - 'dev/log/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ); - if ($logActive || $this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { - $logFile = $this->_scopeConfig->getValue( - 'dev/log/file', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ); - $logExceptionFile = $this->_scopeConfig->getValue( - 'dev/log/exception_file', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, - $store - ); - $this->_log->unsetLoggers(); - $this->_log->addStreamLog( - \Magento\Framework\Logger::LOGGER_SYSTEM, - $logFile, - $this->_writerModel - ); - $this->_log->addStreamLog( - \Magento\Framework\Logger::LOGGER_EXCEPTION, - $logExceptionFile, - $this->_writerModel - ); - } } } return $this->_cache[$className]; diff --git a/composer.json b/composer.json index 7d2f652018410..27195619178b8 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "zendframework/zend-log": "2.3.1", "zendframework/zend-http": "2.3.1", "magento/zendframework1": "1.12.9", - "composer/composer": "1.0.0-alpha8" + "composer/composer": "1.0.0-alpha8", + "monolog/monolog": "1.11.0" }, "require-dev": { "phpunit/phpunit": "4.1.0", diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php index c97c2565cbabd..31f4202d6289a 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php @@ -47,17 +47,15 @@ public function getMessages() /** * @param string $message * @param int $level - * @param string $loggerKey */ - public function log($message, $level = \Zend_Log::DEBUG, $loggerKey = \Magento\Framework\Logger::LOGGER_SYSTEM) + public function log($message, $level = \Zend_Log::DEBUG) { if ($level <= $this->minimumErrorLevel) { $this->messages[] = [ - 'logger' => $loggerKey, 'level' => $level, 'message' => $message, ]; } - parent::log($message, $level, $loggerKey); + parent::log($message, $level); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index 1b0e8eaa4dea6..df6071a6b64ab 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -297,8 +297,7 @@ public function testGetFileLayoutUpdatesXml() $this->_logger->expects($this->atLeastOnce())->method('log') ->with( $this->stringStartsWith($errorString), - \Zend_Log::ERR, - \Magento\Framework\Logger::LOGGER_SYSTEM + \Zend_Log::ERR ); $actualXml = $this->_model->getFileLayoutUpdatesXml(); diff --git a/dev/tests/unit/testsuite/Magento/Framework/LoggerTest.php b/dev/tests/unit/testsuite/Magento/Framework/LoggerTest.php deleted file mode 100644 index a1b3f8cdce74b..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Framework/LoggerTest.php +++ /dev/null @@ -1,211 +0,0 @@ -deleteDirectory(self::$logDir); - } - - protected function setUp() - { - $logDir = self::$logDir; - $this->filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->directory = $this->getMock('Magento\Framework\Filesystem\Directory\Write', [], [], '', false); - $this->filesystemMock->expects($this->any()) - ->method('getDirectoryWrite') - ->with(DirectoryList::LOG) - ->will($this->returnValue($this->directory)); - $this->directory->expects($this->any())->method('create')->will($this->returnValue(true)); - $this->directory->expects($this->any())->method('getAbsolutePath')->will( - $this->returnCallback( - function ($path) use ($logDir) { - $path = ltrim($path, '\/'); - return $logDir . '/' . $path; - } - ) - ); - - $this->model = new \Magento\Framework\Logger($this->filesystemMock); - $this->loggersProperty = new \ReflectionProperty($this->model, '_loggers'); - $this->loggersProperty->setAccessible(true); - } - - protected function tearDown() - { - $this->model = null; // will cause __descruct() in the underlying log class, which will close the open log files - } - - /** - * @param string $key - * @param string $fileOrWrapper - * @dataProvider addStreamLogDataProvider - */ - public function testAddStreamLog($key, $fileOrWrapper) - { - $this->assertFalse($this->model->hasLog($key)); - $this->model->addStreamLog($key, $fileOrWrapper); - $this->assertTrue($this->model->hasLog($key)); - - $loggers = $this->loggersProperty->getValue($this->model); - $this->assertArrayHasKey($key, $loggers); - $zendLog = $loggers[$key]; - $this->assertInstanceOf('Zend_Log', $zendLog); - - $writersProperty = new \ReflectionProperty($zendLog, '_writers'); - $writersProperty->setAccessible(true); - $writers = $writersProperty->getValue($zendLog); - $this->assertArrayHasKey(0, $writers); - $stream = $writers[0]; - $this->assertInstanceOf('Zend_Log_Writer_Stream', $writers[0]); - - $streamProperty = new \ReflectionProperty($stream, '_stream'); - $streamProperty->setAccessible(true); - $fileOrWrapper = $streamProperty->getValue($stream); - $this->assertInternalType('resource', $fileOrWrapper); - $this->assertEquals('stream', get_resource_type($fileOrWrapper)); - } - - /** - * @return array - */ - public function addStreamLogDataProvider() - { - return [['test', 'php://output'], ['test', 'custom_file.log'], ['test', '']]; - } - - /** - * @covers \Magento\Framework\Logger::hasLog - */ - public function testAddLogWithSpecificKey() - { - $key = uniqid(); - $this->model->addStreamLog($key); - $this->assertTrue($this->model->hasLog($key)); - } - - public function testLog() - { - $messageOne = uniqid(); - $messageTwo = uniqid(); - $messageThree = uniqid(); - $this->expectOutputRegex( - '/' . 'DEBUG \(7\).+?' . $messageTwo . '.+?' . 'CRIT \(2\).+?' . $messageThree . '/s' - ); - $this->model->addStreamLog('test', 'php://output'); - $this->model->log($messageOne); - $this->model->log($messageTwo, \Zend_Log::DEBUG, 'test'); - $this->model->log($messageThree, \Zend_Log::CRIT, 'test'); - } - - public function testLogComplex() - { - $this->expectOutputRegex('/Array\s\(\s+\[0\] => 1\s\).+stdClass Object/s'); - $this->model->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM, 'php://output'); - $this->model->log([1]); - $this->model->log(new \StdClass()); - $this->model->log('key'); - } - - public function testLogNoKey() - { - $key = 'key'; - $this->model->log($key); - $this->assertFalse($this->model->hasLog($key)); - } - - public function testLogDebug() - { - $message = uniqid(); - /** @var $model \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ - $model = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); - $model->expects($this->at(0)) - ->method('log') - ->with($message, \Zend_Log::DEBUG, \Magento\Framework\Logger::LOGGER_SYSTEM); - $model->expects($this->at(1)) - ->method('log') - ->with( - $message, - \Zend_Log::DEBUG, - \Magento\Framework\Logger::LOGGER_EXCEPTION - ); - $model->logDebug($message); - $model->logDebug($message, \Magento\Framework\Logger::LOGGER_EXCEPTION); - } - - public function testLogException() - { - $exception = new \Exception(); - $expected = "\n{$exception}"; - /** @var $model \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ - $model = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); - $model->expects($this->at(0)) - ->method('log') - ->with( - $expected, - \Zend_Log::ERR, - \Magento\Framework\Logger::LOGGER_EXCEPTION - ); - $model->logException($exception); - } - - public function testUnsetLoggers() - { - $key = 'test'; - $fileOrWrapper = 'custom_file.log'; - $this->model->addStreamLog($key, $fileOrWrapper); - $this->assertTrue($this->model->hasLog($key)); - $this->model->unsetLoggers(); - $this->assertFalse($this->model->hasLog($key)); - } - - public function testLogFile() - { - $message = ['Wrong file name', 'Avoid using special chars']; - $filename = 'custom_file.log'; - $this->model->logFile($message, \Zend_Log::DEBUG); - $this->model->logFile($message, \Zend_Log::DEBUG, $filename); - $this->assertTrue($this->model->hasLog($filename)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php index 96db910fd4e1c..265e3a3197ad5 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php @@ -207,8 +207,7 @@ public function testAddException() 'logFile' )->with( $this->stringStartsWith($logText), - \Zend_Log::DEBUG, - \Magento\Framework\Logger::LOGGER_EXCEPTION + \Zend_Log::DEBUG ); $messageCollection = $this->getMockBuilder( diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php index 40baf58ed1c81..ea82acf99e2a3 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StorageFactoryTest.php @@ -119,7 +119,6 @@ protected function setUp() '', false ); - $this->_logMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); $this->_sidResolverMock = $this->getMock( '\Magento\Framework\Session\SidResolverInterface', [], @@ -138,7 +137,6 @@ protected function setUp() $this->_model = $this->helper->getObject('\Magento\Store\Model\StorageFactory', [ 'objectManager' => $this->_objectManagerMock, 'eventManager' => $this->_eventManagerMock, - 'logger' => $this->_logMock, 'sidResolver' => $this->_sidResolverMock, 'appState' => $this->_appStateMock, 'httpContext' => $this->_httpContext, @@ -183,7 +181,7 @@ public function testGetModeWithInternalCache() { $store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); - $this->_storeManager->expects($this->exactly(3))->method('getStore')->will($this->returnValue($store)); + $this->_storeManager->expects($this->exactly(2))->method('getStore')->will($this->returnValue($store)); $this->_scopeConfig->expects( $this->at(0) @@ -196,17 +194,6 @@ public function testGetModeWithInternalCache() $this->returnValue(true) ); - $this->_scopeConfig->expects( - $this->at(1) - )->method( - 'isSetFlag' - )->with( - 'dev/log/active', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - )->will( - $this->returnValue(true) - ); - $this->_objectManagerMock->expects( $this->once() )->method( @@ -225,8 +212,6 @@ public function testGetModeWithInternalCache() 'core_app_init_current_store_after' ); - $this->_logMock->expects($this->once())->method('unsetLoggers'); - $this->_logMock->expects($this->exactly(2))->method('addStreamLog'); $this->_sidResolverMock->expects($this->once())->method('setUseSessionInUrl')->with(true); @@ -255,7 +240,6 @@ public function testGetWithInvalidStorageClassName() ); $this->_eventManagerMock->expects($this->never())->method('dispatch'); - $this->_logMock->expects($this->never())->method('initForStore'); $this->_sidResolverMock->expects($this->never())->method('setUseSessionInUrl'); /** test create instance */ diff --git a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php index 8a2222a26956c..e79cdf57d8a79 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php +++ b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php @@ -675,7 +675,6 @@ protected function _prepareDestination($destination = null, $newName = null) try { $this->directoryWrite->create($this->directoryWrite->getRelativePath($destination)); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->logger->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM); $this->logger->log($e->getMessage()); throw new \Exception('Unable to write file into directory ' . $destination . '. Access forbidden.'); } diff --git a/lib/internal/Magento/Framework/Logger.php b/lib/internal/Magento/Framework/Logger.php index 378f2099dc4b7..b2e848502eab3 100644 --- a/lib/internal/Magento/Framework/Logger.php +++ b/lib/internal/Magento/Framework/Logger.php @@ -4,20 +4,11 @@ */ namespace Magento\Framework; -use Magento\Framework\App\Filesystem\DirectoryList; - /** * Logger model */ class Logger { - /**#@+ - * Keys that stand for particular log streams - */ - const LOGGER_SYSTEM = 'system'; - - const LOGGER_EXCEPTION = 'exception'; - /**#@-*/ /** @@ -25,93 +16,19 @@ class Logger */ protected $_loggers = []; - /** - * @var \Magento\Framework\Filesystem - */ - protected $_filesystem; - - /** - * @param \Magento\Framework\Filesystem $filesystem - * @param string $defaultFile - */ - public function __construct(\Magento\Framework\Filesystem $filesystem, $defaultFile = '') - { - $this->_filesystem = $filesystem; - $this->addStreamLog(self::LOGGER_SYSTEM, $defaultFile)->addStreamLog(self::LOGGER_EXCEPTION, $defaultFile); - } - - /** - * Add a logger by specified key - * - * Second argument is a file name (relative to log directory) or a PHP "wrapper" - * - * @param string $loggerKey - * @param string $fileOrWrapper - * @param string $writerClass - * @return \Magento\Framework\Logger - * @link http://php.net/wrappers - */ - public function addStreamLog($loggerKey, $fileOrWrapper = '', $writerClass = '') - { - $file = $fileOrWrapper ?: "{$loggerKey}.log"; - if (!preg_match('#^[a-z][a-z0-9+.-]*\://#i', $file)) { - $logDir = $this->_filesystem->getDirectoryWrite(DirectoryList::LOG); - $logDir->create(); - $file = $logDir->getAbsolutePath($file); - } - if (!$writerClass || !is_subclass_of($writerClass, 'Zend_Log_Writer_Stream')) { - $writerClass = 'Zend_Log_Writer_Stream'; - } - /** @var $writer \Zend_Log_Writer_Stream */ - $writer = $writerClass::factory(['stream' => $file]); - $writer->setFormatter( - new \Zend_Log_Formatter_Simple('%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL) - ); - $this->_loggers[$loggerKey] = new \Zend_Log($writer); - return $this; - } - - /** - * Unset all declared loggers - * - * @return $this - */ - public function unsetLoggers() - { - $this->_loggers = []; - return $this; - } - - /** - * Check whether a logger exists by specified key - * - * @param string $key - * @return bool - */ - public function hasLog($key) - { - return isset($this->_loggers[$key]); - } - /** * Log a message * * @param string $message * @param int $level - * @param string $loggerKey * @return void */ - public function log($message, $level = \Zend_Log::DEBUG, $loggerKey = self::LOGGER_SYSTEM) + public function log($message, $level = \Zend_Log::DEBUG) { - if (!isset($this->_loggers[$loggerKey])) { - return; - } if (is_array($message) || is_object($message)) { $message = print_r($message, true); } - /** @var $logger \Zend_Log */ - $logger = $this->_loggers[$loggerKey]; - $logger->log($message, $level); + $this->log($message, $level); } /** @@ -131,10 +48,6 @@ public function logFile($message, $level = \Zend_Log::DEBUG, $file = '') $message = print_r($message, true); } /** @var $logger \Zend_Log */ - if (!$this->hasLog($file)) { - $this->addStreamLog($file, $file); - } - /** @var $logger \Zend_Log */ $this->log($message, $level, $file); } @@ -145,9 +58,9 @@ public function logFile($message, $level = \Zend_Log::DEBUG, $file = '') * @param string $loggerKey * @return void */ - public function logDebug($message, $loggerKey = self::LOGGER_SYSTEM) + public function logDebug($message) { - $this->log($message, \Zend_Log::DEBUG, $loggerKey); + $this->log($message, \Zend_Log::DEBUG); } /** @@ -158,6 +71,6 @@ public function logDebug($message, $loggerKey = self::LOGGER_SYSTEM) */ public function logException(\Exception $e) { - $this->log("\n" . $e->__toString(), \Zend_Log::ERR, self::LOGGER_EXCEPTION); + $this->log("\n" . $e->__toString(), \Zend_Log::ERR); } } diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 01c7eee8f42a7..9b94a8ec22e94 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -258,7 +258,7 @@ public function addException(\Exception $exception, $alternativeText, $group = n $exception->getTraceAsString() ); - $this->logger->logFile($message, \Zend_Log::DEBUG, Logger::LOGGER_EXCEPTION); + $this->logger->logFile($message, \Zend_Log::DEBUG); $this->addMessage($this->messageFactory->create(MessageInterface::TYPE_ERROR, $alternativeText), $group); return $this; } From 42236bcc7ec0ec401c1f577f0666f6608af14868 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 18 Dec 2014 15:07:51 +0200 Subject: [PATCH 02/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - rename logException to critical --- .../Magento/Authorization/Model/Acl/AclRetriever.php | 2 +- .../Magento/Authorization/Model/Resource/Rules.php | 2 +- .../Adminhtml/Authorizenet/Payment/Cancel.php | 4 ++-- .../Controller/Authorizenet/Payment/Cancel.php | 4 ++-- .../Authorizenet/Controller/Directpost/Payment.php | 4 ++-- app/code/Magento/Authorizenet/Model/Directpost.php | 4 ++-- .../Backend/Block/Widget/Grid/Column/Renderer/Date.php | 2 +- .../Block/Widget/Grid/Column/Renderer/Datetime.php | 2 +- .../Backend/Controller/Adminhtml/Dashboard/Tunnel.php | 2 +- .../Adminhtml/System/Config/System/Storage/Status.php | 2 +- .../System/Config/System/Storage/Synchronize.php | 2 +- app/code/Magento/Backend/Model/Menu/Config.php | 6 +++--- app/code/Magento/Backup/Model/Observer.php | 2 +- .../Catalog/Controller/Adminhtml/Category/Move.php | 2 +- .../Catalog/Controller/Adminhtml/Product/Builder.php | 2 +- .../Catalog/Controller/Adminhtml/Product/Duplicate.php | 2 +- .../Catalog/Controller/Adminhtml/Product/Save.php | 2 +- app/code/Magento/Catalog/Controller/Category/View.php | 2 +- app/code/Magento/Catalog/Controller/Product/View.php | 2 +- app/code/Magento/Catalog/Helper/Image.php | 2 +- app/code/Magento/Catalog/Helper/Product.php | 2 +- .../Magento/Catalog/Helper/Product/Flat/Indexer.php | 2 +- .../Catalog/Model/Category/Attribute/Backend/Image.php | 2 +- .../Catalog/Model/Product/Type/AbstractType.php | 2 +- .../Magento/Catalog/Pricing/Render/FinalPriceBox.php | 2 +- .../CatalogImportExport/Model/Export/Product.php | 2 +- .../CatalogImportExport/Model/Import/Product.php | 2 +- .../Controller/Adminhtml/Promo/Catalog/ApplyRules.php | 2 +- .../Controller/Adminhtml/Promo/Catalog/Delete.php | 2 +- .../Controller/Adminhtml/Promo/Catalog/Save.php | 2 +- .../Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 10 +++++----- .../Adminhtml/Centinel/Index/ValidatePaymentData.php | 2 +- app/code/Magento/Checkout/Controller/Cart/Add.php | 2 +- app/code/Magento/Checkout/Controller/Cart/Addgroup.php | 2 +- .../Magento/Checkout/Controller/Cart/Configure.php | 2 +- .../Magento/Checkout/Controller/Cart/CouponPost.php | 2 +- app/code/Magento/Checkout/Controller/Cart/Delete.php | 2 +- .../Checkout/Controller/Cart/UpdateItemOptions.php | 2 +- .../Magento/Checkout/Controller/Cart/UpdatePost.php | 2 +- .../Magento/Checkout/Controller/Onepage/SaveOrder.php | 4 ++-- .../Checkout/Controller/Onepage/SavePayment.php | 2 +- app/code/Magento/Checkout/Model/Type/Onepage.php | 4 ++-- .../Service/V1/Address/Billing/WriteService.php | 2 +- .../Service/V1/Address/Shipping/WriteService.php | 2 +- .../Cms/Controller/Adminhtml/Wysiwyg/Directive.php | 2 +- app/code/Magento/Core/Model/File/Storage/Database.php | 2 +- .../Core/Model/File/Storage/Directory/Database.php | 2 +- app/code/Magento/Core/Model/File/Storage/File.php | 6 +++--- app/code/Magento/Core/Model/Observer.php | 4 ++-- .../Block/Adminhtml/Edit/Tab/View/PersonalInfo.php | 2 +- .../Magento/Customer/Controller/Account/LoginPost.php | 2 +- .../Customer/Controller/Adminhtml/Index/Wishlist.php | 2 +- app/code/Magento/Customer/Model/AccountManagement.php | 8 ++++---- app/code/Magento/Customer/Model/Metadata/Form/File.php | 2 +- app/code/Magento/Customer/Model/Vat.php | 2 +- app/code/Magento/Customer/Model/Visitor.php | 2 +- .../Controller/Adminhtml/System/Design/Editor.php | 2 +- .../System/Design/Editor/AssignThemeToStore.php | 2 +- .../Adminhtml/System/Design/Editor/Duplicate.php | 4 ++-- .../Adminhtml/System/Design/Editor/Files/TreeJson.php | 2 +- .../Adminhtml/System/Design/Editor/Launch.php | 4 ++-- .../Adminhtml/System/Design/Editor/LoadThemeList.php | 2 +- .../Adminhtml/System/Design/Editor/QuickEdit.php | 4 ++-- .../Adminhtml/System/Design/Editor/Revert.php | 2 +- .../Controller/Adminhtml/System/Design/Editor/Save.php | 2 +- .../System/Design/Editor/Tools/DeleteCustomFiles.php | 2 +- .../Adminhtml/System/Design/Editor/Tools/JsList.php | 2 +- .../Design/Editor/Tools/RemoveQuickStyleImage.php | 4 ++-- .../System/Design/Editor/Tools/RemoveStoreLogo.php | 4 ++-- .../Adminhtml/System/Design/Editor/Tools/ReorderJs.php | 4 ++-- .../System/Design/Editor/Tools/SaveCssContent.php | 4 ++-- .../System/Design/Editor/Tools/SaveImageSizing.php | 4 ++-- .../System/Design/Editor/Tools/SaveQuickStyles.php | 4 ++-- .../Adminhtml/System/Design/Editor/Tools/Upload.php | 4 ++-- .../Adminhtml/System/Design/Editor/Tools/UploadJs.php | 4 ++-- .../Design/Editor/Tools/UploadQuickStyleImage.php | 4 ++-- .../System/Design/Editor/Tools/UploadStoreLogo.php | 4 ++-- app/code/Magento/Directory/Model/PriceCurrency.php | 2 +- app/code/Magento/Eav/Model/Attribute/Data/File.php | 2 +- .../Adminhtml/Email/Template/DefaultTemplate.php | 2 +- .../Controller/Adminhtml/Email/Template/Delete.php | 2 +- app/code/Magento/Email/Model/Template/Filter.php | 2 +- app/code/Magento/Fedex/Model/Carrier.php | 6 +++--- .../Adminhtml/Googleshopping/Items/ConfirmCaptcha.php | 2 +- .../Adminhtml/Googleshopping/Items/MassAdd.php | 2 +- .../Adminhtml/Googleshopping/Items/Refresh.php | 2 +- .../Adminhtml/Googleshopping/Types/Delete.php | 2 +- .../Controller/Adminhtml/Googleshopping/Types/Edit.php | 2 +- .../Googleshopping/Types/LoadAttributeSets.php | 2 +- .../Adminhtml/Googleshopping/Types/LoadAttributes.php | 2 +- .../Adminhtml/Googleshopping/Types/NewAction.php | 2 +- .../Controller/Adminhtml/Googleshopping/Types/Save.php | 2 +- .../Magento/GoogleShopping/Model/MassOperations.php | 6 +++--- .../GroupedProduct/Controller/Adminhtml/Edit/Popup.php | 2 +- .../Controller/Adminhtml/Export/Export.php | 2 +- app/code/Magento/ImportExport/Model/Export.php | 4 ++-- app/code/Magento/ImportExport/Model/Import.php | 2 +- .../Controller/Adminhtml/Integration/Delete.php | 2 +- .../Controller/Adminhtml/Integration/Edit.php | 2 +- .../Adminhtml/Integration/PermissionsDialog.php | 2 +- .../Controller/Adminhtml/Integration/Save.php | 4 ++-- .../Controller/Adminhtml/Integration/TokensDialog.php | 2 +- .../Adminhtml/Integration/TokensExchange.php | 2 +- .../Integration/Service/V1/AuthorizationService.php | 4 ++-- app/code/Magento/Integration/Service/V1/Oauth.php | 2 +- app/code/Magento/Log/Model/Visitor.php | 2 +- .../Multishipping/Controller/Checkout/Overview.php | 2 +- .../Multishipping/Controller/Checkout/OverviewPost.php | 2 +- app/code/Magento/Newsletter/Model/Subscriber.php | 2 +- .../Model/Resource/Carrier/Tablerate.php | 2 +- .../Controller/Adminhtml/Billing/Agreement/Cancel.php | 2 +- .../Controller/Adminhtml/Billing/Agreement/Delete.php | 2 +- .../Controller/Adminhtml/Paypal/Reports/Fetch.php | 4 ++-- .../Paypal/Controller/Billing/Agreement/Cancel.php | 2 +- .../Controller/Billing/Agreement/ReturnWizard.php | 2 +- .../Controller/Billing/Agreement/StartWizard.php | 2 +- .../Controller/Express/AbstractExpress/Cancel.php | 2 +- .../Controller/Express/AbstractExpress/PlaceOrder.php | 2 +- .../Express/AbstractExpress/ReturnAction.php | 2 +- .../Controller/Express/AbstractExpress/Review.php | 2 +- .../Express/AbstractExpress/SaveShippingMethod.php | 2 +- .../AbstractExpress/ShippingOptionsCallback.php | 2 +- .../Controller/Express/AbstractExpress/Start.php | 2 +- .../Express/AbstractExpress/UpdateShippingMethods.php | 2 +- app/code/Magento/Paypal/Controller/Ipn/Index.php | 4 ++-- .../Magento/Paypal/Controller/Payflow/SilentPost.php | 2 +- app/code/Magento/Paypal/Model/Api/Nvp.php | 6 +++--- app/code/Magento/Paypal/Model/Api/PayflowNvp.php | 2 +- app/code/Magento/Paypal/Model/Express/Checkout.php | 4 ++-- app/code/Magento/Paypal/Model/Observer.php | 4 ++-- .../Controller/Adminhtml/Report/Product/Viewed.php | 2 +- .../Adminhtml/Report/Statistics/RefreshLifetime.php | 2 +- .../Adminhtml/Report/Statistics/RefreshRecent.php | 2 +- .../Reports/Model/Resource/Report/AbstractReport.php | 2 +- app/code/Magento/Review/Controller/Product.php | 2 +- app/code/Magento/Review/Model/Resource/Rating.php | 4 ++-- .../Rss/App/Action/Plugin/BackendAuthentication.php | 2 +- app/code/Magento/Rss/Controller/Feed.php | 2 +- app/code/Magento/Rule/Model/Condition/Combine.php | 2 +- .../Sales/Controller/Adminhtml/Order/Cancel.php | 2 +- .../Controller/Adminhtml/Order/Creditmemo/Save.php | 2 +- .../Magento/Sales/Controller/Adminhtml/Order/Email.php | 2 +- .../Sales/Controller/Adminhtml/Order/Invoice/Save.php | 6 +++--- .../Sales/Controller/Adminhtml/Order/ReviewPayment.php | 2 +- .../Magento/Sales/Controller/Adminhtml/Order/View.php | 2 +- .../Sales/Controller/Adminhtml/Order/VoidPayment.php | 2 +- .../Sales/Controller/Adminhtml/Transactions/Fetch.php | 2 +- app/code/Magento/Sales/Model/AbstractNotifier.php | 2 +- app/code/Magento/Sales/Model/AdminOrder/Create.php | 2 +- .../Magento/Sales/Model/AdminOrder/EmailSender.php | 2 +- .../Controller/Adminhtml/Promo/Quote/Delete.php | 2 +- .../Controller/Adminhtml/Promo/Quote/Generate.php | 2 +- .../Controller/Adminhtml/Promo/Quote/Save.php | 2 +- .../Adminhtml/Order/Shipment/CreateLabel.php | 2 +- .../Controller/Adminhtml/Order/Shipment/PrintLabel.php | 2 +- .../Controller/Adminhtml/Order/Shipment/Save.php | 2 +- .../Adminhtml/System/Design/Theme/Delete.php | 2 +- .../Adminhtml/System/Design/Theme/DownloadCss.php | 2 +- .../System/Design/Theme/DownloadCustomCss.php | 2 +- .../Controller/Adminhtml/System/Design/Theme/Edit.php | 2 +- .../Controller/Adminhtml/System/Design/Theme/Save.php | 2 +- .../Adminhtml/System/Design/Theme/UploadCss.php | 2 +- .../Adminhtml/System/Design/Theme/UploadJs.php | 2 +- .../System/Design/Wysiwyg/Files/NewFolder.php | 2 +- .../System/Design/Wysiwyg/Files/PreviewImage.php | 2 +- .../Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php | 2 +- app/code/Magento/Theme/Model/Wysiwyg/Storage.php | 2 +- app/code/Magento/Webapi/Controller/ErrorProcessor.php | 10 +++++----- .../Controller/Adminhtml/Widget/Instance/Save.php | 2 +- app/code/Magento/Wishlist/Controller/Index/Add.php | 2 +- .../Magento/Wishlist/Controller/Index/Configure.php | 2 +- app/code/Magento/Wishlist/Controller/Index/Update.php | 2 +- .../Wishlist/Controller/Index/UpdateItemOptions.php | 2 +- app/code/Magento/Wishlist/Model/ItemCarrier.php | 2 +- .../Service/V1/AuthorizationServiceTest.php | 2 +- .../Magento/Translation/Model/InlineParserTest.php | 2 +- .../Magento/Test/Legacy/_files/obsolete_methods.php | 2 +- .../Controller/Adminhtml/Dashboard/TunnelTest.php | 4 ++-- .../Magento/Backend/Model/Menu/ConfigTest.php | 4 ++-- .../Backend/Model/Menu/Director/DirectorTest.php | 2 +- .../Controller/Adminhtml/Product/BuilderTest.php | 2 +- .../Catalog/Pricing/Render/FinalPriceBoxTest.php | 2 +- .../Core/Model/File/Storage/Directory/DatabaseTest.php | 2 +- .../testsuite/Magento/Framework/DB/Logger/FileTest.php | 4 ++-- .../Magento/Framework/View/Asset/MergedTest.php | 6 +++--- .../Magento/Framework/View/Asset/MinifiedTest.php | 2 +- .../Framework/View/Page/Config/RendererTest.php | 2 +- .../Adminhtml/Googleshopping/Items/MassAddTest.php | 2 +- .../Adminhtml/Googleshopping/Items/RefreshTest.php | 2 +- .../Controller/Adminhtml/IntegrationTest.php | 4 ++-- .../Magento/Integration/Helper/Oauth/ConsumerTest.php | 2 +- .../Magento/Paypal/Controller/Ipn/IndexTest.php | 2 +- .../Magento/Rule/Model/Condition/CombineTest.php | 4 ++-- .../Magento/Sales/Model/AdminOrder/EmailSenderTest.php | 2 +- .../Sales/Model/Order/CreditmemoNotifierTest.php | 4 ++-- .../Magento/Sales/Model/Order/InvoiceNotifierTest.php | 4 ++-- .../Magento/Sales/Model/OrderNotifierTest.php | 4 ++-- .../Adminhtml/Order/Shipment/CreateLabelTest.php | 4 ++-- .../Adminhtml/Order/Shipment/PrintLabelTest.php | 4 ++-- .../Magento/Shipping/Model/ShipmentNotifierTest.php | 4 ++-- .../Magento/Webapi/Controller/ErrorProcessorTest.php | 2 +- lib/internal/Magento/Framework/App/Area.php | 2 +- lib/internal/Magento/Framework/App/Bootstrap.php | 2 +- .../Magento/Framework/DB/Adapter/Pdo/Mysql.php | 2 +- lib/internal/Magento/Framework/DB/Logger/File.php | 2 +- lib/internal/Magento/Framework/DB/Logger/Null.php | 2 +- lib/internal/Magento/Framework/DB/LoggerInterface.php | 2 +- .../Framework/Less/PreProcessor/ErrorHandler.php | 2 +- lib/internal/Magento/Framework/Logger.php | 2 +- lib/internal/Magento/Framework/View/Asset/Merged.php | 2 +- lib/internal/Magento/Framework/View/Asset/Minified.php | 2 +- .../Magento/Framework/View/Design/Theme/Image.php | 2 +- .../Magento/Framework/View/Element/AbstractBlock.php | 2 +- .../Magento/Framework/View/Page/Config/Renderer.php | 2 +- lib/internal/Magento/Framework/View/Result/Page.php | 2 +- 215 files changed, 279 insertions(+), 279 deletions(-) diff --git a/app/code/Magento/Authorization/Model/Acl/AclRetriever.php b/app/code/Magento/Authorization/Model/Acl/AclRetriever.php index 3837a7babb2f3..51bd53b2d3f5b 100644 --- a/app/code/Magento/Authorization/Model/Acl/AclRetriever.php +++ b/app/code/Magento/Authorization/Model/Acl/AclRetriever.php @@ -79,7 +79,7 @@ public function getAllowedResourcesByUser($userType, $userId) } catch (AuthorizationException $e) { throw $e; } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); throw new LocalizedException( 'Error happened while getting a list of allowed resources. Check exception log for details.' ); diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index e367b05e2cfb0..a89e3e33d1a57 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -116,7 +116,7 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule) throw $e; } catch (\Exception $e) { $adapter->rollBack(); - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php index b9eb0414ef72f..b0c979f96ef5f 100644 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php +++ b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php @@ -51,10 +51,10 @@ public function execute() $this->_view ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['error_message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['error_message'] = __('Something went wrong canceling the transactions.'); } diff --git a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php index 6963049e7fd5e..72e366c7eb939 100644 --- a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php +++ b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php @@ -50,10 +50,10 @@ public function execute() $this->_view ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['error_message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['error_message'] = __( 'There was an error canceling transactions. Please contact us or try again later.' ); diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php index b1230ac217ca9..2e34c219ef393 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php @@ -74,11 +74,11 @@ protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface $paymentMethod->process($data); $result['success'] = 1; } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['success'] = 0; $result['error_msg'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['success'] = 0; $result['error_msg'] = __('We couldn\'t process your order right now. Please try again later.'); } diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index 7013687d3e1e6..cfc9eed47103c 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -727,7 +727,7 @@ protected function _declineOrder(\Magento\Sales\Model\Order $order, $message = ' $order->registerCancellation($message)->save(); } catch (\Exception $e) { //quiet decline - $this->_logger->logException($e); + $this->_logger->critical($e); } } @@ -766,7 +766,7 @@ protected function _captureOrder(\Magento\Sales\Model\Order $order) $order->save(); } catch (\Exception $e) { //if we couldn't capture order, just leave it as NEW order. - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php index f2b3b0381aa89..f9524ada7933e 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Date.php @@ -45,7 +45,7 @@ protected function _getFormat() \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM ); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } $format = self::$_format; diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php index 3ac62cee213c8..8b6e3f124258d 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -32,7 +32,7 @@ protected function _getFormat() \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM ); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } $format = self::$_format; diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php index 5a2785e0e74f9..f1bd26eedac17 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php @@ -68,7 +68,7 @@ public function execute() ->setContents($response->getBody()); return $resultRaw; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $error = __('see error log for details'); $httpCode = 503; } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php index f3133d990c93c..85a3aa075bf17 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php @@ -80,7 +80,7 @@ public function execute() ) { $this->_objectManager->get( 'Magento\Framework\Logger' - )->logException( + )->critical( new \Magento\Framework\Exception( __('The timeout limit for response from synchronize process was reached.') ) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php index b2b6c0fff5e5d..f2b70585d7a09 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php @@ -43,7 +43,7 @@ public function execute() try { $this->_getSyncSingleton()->synchronize($storage); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $flag->passError($e); } diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index 089f0e1315eb3..52b3e0f2ac8e6 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -105,13 +105,13 @@ public function getMenu() $this->_initMenu(); return $this->_menu; } catch (\InvalidArgumentException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw $e; } catch (\BadMethodCallException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw $e; } catch (\OutOfRangeException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw $e; } catch (\Exception $e) { throw $e; diff --git a/app/code/Magento/Backup/Model/Observer.php b/app/code/Magento/Backup/Model/Observer.php index 0e2d75bc06ec1..77d66b929e18c 100644 --- a/app/code/Magento/Backup/Model/Observer.php +++ b/app/code/Magento/Backup/Model/Observer.php @@ -144,7 +144,7 @@ public function scheduledBackup() $this->_errors[] = $e->getMessage(); $this->_errors[] = $e->getTrace(); $this->_logger->log($e->getMessage(), \Zend_Log::ERR); - $this->_logger->logException($e); + $this->_logger->critical($e); } if ($this->_scopeConfig->isSetFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE, ScopeInterface::SCOPE_STORE)) { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php index f335af5a99dfe..18eda1abf61a4 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php @@ -77,7 +77,7 @@ public function execute() } catch (\Exception $e) { $error = true; $this->messageManager->addError(__('There was a category move error.')); - $this->logger->logException($e); + $this->logger->critical($e); } if (!$error) { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php index 511f9a701d541..758084c10e98d 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php @@ -75,7 +75,7 @@ public function build(RequestInterface $request) $product->load($productId); } catch (\Exception $e) { $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE); - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php index 827d1bdce7961..8c9e23a174509 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php @@ -53,7 +53,7 @@ public function execute() $this->messageManager->addSuccess(__('You duplicated the product.')); $resultRedirect->setPath('catalog/*/edit', ['_current' => true, 'id' => $newProduct->getId()]); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError($e->getMessage()); $resultRedirect->setPath('catalog/*/edit', ['_current' => true]); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php index 38d4776a6f6d7..fe6b003cb26d4 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php @@ -116,7 +116,7 @@ public function execute() $this->_session->setProductData($data); $redirectBack = true; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError($e->getMessage()); $redirectBack = true; } diff --git a/app/code/Magento/Catalog/Controller/Category/View.php b/app/code/Magento/Catalog/Controller/Category/View.php index 4e9df86661064..f256d9ae84f8c 100644 --- a/app/code/Magento/Catalog/Controller/Category/View.php +++ b/app/code/Magento/Catalog/Controller/Category/View.php @@ -123,7 +123,7 @@ protected function _initCategory() ['category' => $category, 'controller_action' => $this] ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); return false; } diff --git a/app/code/Magento/Catalog/Controller/Product/View.php b/app/code/Magento/Catalog/Controller/Product/View.php index 3f36fe958a42c..4f06ccc1c8662 100644 --- a/app/code/Magento/Catalog/Controller/Product/View.php +++ b/app/code/Magento/Catalog/Controller/Product/View.php @@ -111,7 +111,7 @@ public function execute() if ($e->getCode() == $this->viewHelper->ERR_NO_PRODUCT_LOADED) { return $this->noProductRedirect(); } else { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $resultForward = $this->resultForwardFactory->create(); $resultForward->forward('noroute'); return $resultForward; diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 9388d17fda737..e232b7280a793 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -417,7 +417,7 @@ protected function getDefaultPlaceholderUrl() try { $url = $this->_assetRepo->getUrl($this->getPlaceholder()); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $url = $this->_urlBuilder->getUrl('', ['_direct' => 'core/index/notFound']); } return $url; diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index 4503f58d1ec83..b26f922a2abff 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -448,7 +448,7 @@ public function initProduct($productId, $controller, $params = null) ['product' => $product, 'controller_action' => $controller] ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return false; } diff --git a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php index 52473fe4834d1..e029df6c439b4 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php @@ -304,7 +304,7 @@ public function getAttributes() $attribute->getBackend(); $this->_attributes[$attributeCode] = $attribute; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 4ab260e6e4cf6..7a23c7247e999 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -93,7 +93,7 @@ public function afterSave($object) $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName()); } catch (\Exception $e) { if ($e->getCode() != \Magento\Core\Model\File\Uploader::TMP_NAME_EMPTY) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } return $this; diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 645c2437f5738..3e14401a39a70 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -1005,7 +1005,7 @@ public function checkProductConfiguration($product, $buyRequest) } catch (\Magento\Framework\Model\Exception $e) { $errors[] = $e->getMessages(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $errors[] = __('Something went wrong while processing the request.'); } diff --git a/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php b/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php index ceaaba2fcc5c9..9b9feb713dcb2 100644 --- a/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php +++ b/app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php @@ -33,7 +33,7 @@ protected function _toHtml() /** @var MsrpPrice $msrpPriceType */ $msrpPriceType = $this->getSaleableItem()->getPriceInfo()->getPrice('msrp_price'); } catch (\InvalidArgumentException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return $this->wrapResult($result); } diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index a8b42a77aeab7..125fe87f102ea 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -1103,7 +1103,7 @@ protected function _getExportData() } } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return $exportData; } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 8f59ba1aa57c2..46cd4b7703ae5 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1102,7 +1102,7 @@ protected function _saveLinks() if ($linkedId == null) { // Import file links to a SKU which is skipped for some reason, which leads to a "NULL" // link causing fatal errors. - $this->_logger->logException( + $this->_logger->critical( new \Exception( sprintf( 'WARNING: Orphaned link skipped: From SKU %s (ID %d) to SKU %s, ' . diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php index 923ce9bd10c70..d93e05df6fc46 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($errorMessage . ' ' . $ruleJob->getError()); } } catch (\Exception $e) { - $this->_objectManager->create('Magento\Framework\Logger')->logException($e); + $this->_objectManager->create('Magento\Framework\Logger')->critical($e); $this->messageManager->addError($errorMessage); } $this->_redirect('catalog_rule/*'); diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php index 440407f0e168c..cf530d0bb75c2 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php @@ -31,7 +31,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting the rule. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('id')]); return; } diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php index 7124feaa8c9f7..828979b6304e5 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php @@ -75,7 +75,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while saving the rule data. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_objectManager->get('Magento\Backend\Model\Session')->setPageData($data); $this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('rule_id')]); return; diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 690e8e5a35cc2..0e5a2e3c3c2a2 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -129,7 +129,7 @@ public function reindexByIds(array $ids) try { $this->doReindexByIds($ids); } catch (\Exception $e) { - $this->logException($e); + $this->critical($e); throw new CatalogRuleException($e->getMessage(), $e->getCode(), $e); } } @@ -162,7 +162,7 @@ public function reindexFull() try { $this->doReindexFull(); } catch (\Exception $e) { - $this->logException($e); + $this->critical($e); throw new CatalogRuleException($e->getMessage(), $e->getCode(), $e); } } @@ -551,7 +551,7 @@ protected function calcRuleProductPrice($ruleData, $productData = null) /** * @param int $websiteId * @param int|null $productId - * @return \Zend\Db\Adapter\Driver\StatementInterface|\Zend_Db_Statement_Interface + * @return \Zend_Db_Statement_Interface * @throws \Magento\Eav\Exception */ protected function getRuleProductsStmt($websiteId, $productId = null) @@ -691,8 +691,8 @@ protected function getProduct($productId) * @param \Exception $e * @return void */ - protected function logException($e) + protected function critical($e) { - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php index 20a7d48d4ee87..ca56ba6eafe63 100644 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php +++ b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php @@ -27,7 +27,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $result['message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['message'] = __('Validation failed.'); } $this->getResponse()->representJson( diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index 69b4b42b53eef..d65ce4d25fd8d 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -134,7 +134,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot add this item to your shopping cart')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_goBack(); } } diff --git a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php index 08607e38f063f..658864a6afedd 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php +++ b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php @@ -31,7 +31,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot add this item to your shopping cart')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_goBack(); } } diff --git a/app/code/Magento/Checkout/Controller/Cart/Configure.php b/app/code/Magento/Checkout/Controller/Cart/Configure.php index 8731afaae8dce..92b2565d72df8 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Configure.php +++ b/app/code/Magento/Checkout/Controller/Cart/Configure.php @@ -71,7 +71,7 @@ public function execute() return $resultPage; } catch (\Exception $e) { $this->messageManager->addError(__('We cannot configure the product.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_goBack(); return; } diff --git a/app/code/Magento/Checkout/Controller/Cart/CouponPost.php b/app/code/Magento/Checkout/Controller/Cart/CouponPost.php index 346bb38a4a67b..e9eea809d94a1 100644 --- a/app/code/Magento/Checkout/Controller/Cart/CouponPost.php +++ b/app/code/Magento/Checkout/Controller/Cart/CouponPost.php @@ -103,7 +103,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot apply the coupon code.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_goBack(); diff --git a/app/code/Magento/Checkout/Controller/Cart/Delete.php b/app/code/Magento/Checkout/Controller/Cart/Delete.php index 30540402d4ee0..a22b198f81336 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Delete.php +++ b/app/code/Magento/Checkout/Controller/Cart/Delete.php @@ -20,7 +20,7 @@ public function execute() $this->cart->removeItem($id)->save(); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot remove the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } $defaultUrl = $this->_objectManager->create('Magento\Framework\UrlInterface')->getUrl('*/*'); diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php index 91b7c652ae3f6..afdedd5cf203d 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php @@ -83,7 +83,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot update the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_goBack(); } $this->_redirect('*/*'); diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php b/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php index 753e4ac69b007..ab836be0630ee 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php @@ -56,7 +56,7 @@ protected function _updateShoppingCart() ); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot update the shopping cart.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } diff --git a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php index 18fe3c01b92b9..42161ccd2f73e 100644 --- a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php +++ b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php @@ -63,7 +63,7 @@ public function execute() $result['goto_section'] = 'payment'; $result['update_section'] = ['name' => 'payment-method', 'html' => $this->_getPaymentMethodsHtml()]; } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( @@ -91,7 +91,7 @@ public function execute() $this->getOnepage()->getCheckout()->setUpdateSection(null); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( diff --git a/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php b/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php index 9e14aae22b385..01b590b734582 100644 --- a/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php +++ b/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php @@ -56,7 +56,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $result['error'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $result['error'] = __('Unable to set Payment Method'); } $this->getResponse()->representJson( diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 1b11589918e96..d4fb6787fc8d1 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -925,7 +925,7 @@ public function saveOrder() try { $this->_involveNewCustomer(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } @@ -953,7 +953,7 @@ public function saveOrder() try { $this->orderSender->send($order); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php b/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php index 8cb870b3fbdb7..eda52bc6725e9 100644 --- a/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php +++ b/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php @@ -105,7 +105,7 @@ public function setAddress($cartId, $addressData) try { $this->quoteRepository->save($quote); } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); throw new InputException('Unable to save address. Please, check input data.'); } return $quote->getBillingAddress()->getId(); diff --git a/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php b/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php index b58cfd6bab456..233779fb691ce 100644 --- a/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php +++ b/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php @@ -102,7 +102,7 @@ public function setAddress($cartId, $addressData) try { $this->quoteRepository->save($quote); } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); throw new InputException('Unable to save address. Please, check input data.'); } return $quote->getShippingAddress()->getId(); diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index 878071667990f..a6d90682ca49a 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -28,7 +28,7 @@ public function execute() } catch (\Exception $e) { $image->open($this->_objectManager->get('Magento\Cms\Model\Wysiwyg\Config')->getSkinImagePlaceholderUrl()); $response->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/Core/Model/File/Storage/Database.php b/app/code/Magento/Core/Model/File/Storage/Database.php index 61d9202cc4dfe..6484ffcb07031 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Database.php @@ -233,7 +233,7 @@ public function importFiles($files) $this->_getResource()->saveFile($file); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php index be3f8cbd10abc..0174d3b1c9047 100644 --- a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php @@ -201,7 +201,7 @@ public function importDirectories($dirs) throw new \Magento\Framework\Model\Exception(__('Parent directory does not exist: %1', $dir['path'])); } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Core/Model/File/Storage/File.php b/app/code/Magento/Core/Model/File/Storage/File.php index cbc14e1f21fcd..7917ade47ef4a 100644 --- a/app/code/Magento/Core/Model/File/Storage/File.php +++ b/app/code/Magento/Core/Model/File/Storage/File.php @@ -193,7 +193,7 @@ public function exportFiles($offset = 0, $count = 1) try { $fileInfo = $this->_mediaHelper->collectFileInfo($this->getMediaBaseDirectory(), $fileName); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); continue; } @@ -221,7 +221,7 @@ public function import($data, $callback) $this->{$callback}($part); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); - $this->_logger->logException($e); + $this->_logger->critical($e); } } @@ -284,7 +284,7 @@ public function saveFile($file, $overwrite = true) return $this->_fileUtility->saveFile($filename, $file['content'], $overwrite); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception( __('Unable to save file "%1" at "%2"', $file['filename'], $file['directory']) ); diff --git a/app/code/Magento/Core/Model/Observer.php b/app/code/Magento/Core/Model/Observer.php index d3a9341f9f378..b8a6713dee912 100644 --- a/app/code/Magento/Core/Model/Observer.php +++ b/app/code/Magento/Core/Model/Observer.php @@ -102,7 +102,7 @@ public function themeRegistration(\Magento\Framework\Event\Observer $observer) try { $this->_registration->register($pathPattern); } catch (\Magento\Framework\Model\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return $this; } @@ -133,7 +133,7 @@ public function applyThemeCustomization(\Magento\Framework\Event\Observer $obser $this->_pageAssets->add($identifier, $asset); } } catch (\InvalidArgumentException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php index 5701c366a1d50..1e2366b20fb8e 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php @@ -128,7 +128,7 @@ public function getStoreCreateDate() ); return $this->formatDate($date, TimezoneInterface::FORMAT_TYPE_MEDIUM, true); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return ''; } } diff --git a/app/code/Magento/Customer/Controller/Account/LoginPost.php b/app/code/Magento/Customer/Controller/Account/LoginPost.php index 412ed7c140d5d..ad470d2b4e3ea 100644 --- a/app/code/Magento/Customer/Controller/Account/LoginPost.php +++ b/app/code/Magento/Customer/Controller/Account/LoginPost.php @@ -159,7 +159,7 @@ public function execute() $this->_getSession()->setUsername($login['username']); } catch (\Exception $e) { // PA DSS violation: this exception log can disclose customer password - // $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + // $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('There was an error validating the login and password.')); } } else { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php index c1b141f2710bc..854fdfa6e0a52 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php @@ -23,7 +23,7 @@ public function execute() try { $this->_objectManager->create('Magento\Wishlist\Model\Item')->load($itemId)->delete(); } catch (\Exception $exception) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($exception); + $this->_objectManager->get('Magento\Framework\Logger')->critical($exception); } } diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index b9680b1d53405..6e9e80e9d4a65 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -312,7 +312,7 @@ public function resendConfirmation($email, $websiteId = null, $redirectUrl = '') ); } catch (MailException $e) { // If we are not able to send a new account email, this should be ignored - $this->logger->logException($e); + $this->logger->critical($e); } } @@ -432,7 +432,7 @@ public function initiatePasswordReset($email, $template, $websiteId = null) } } catch (MailException $e) { // If we are not able to send a reset password email, this should be ignored - $this->logger->logException($e); + $this->logger->critical($e); } } @@ -585,7 +585,7 @@ protected function sendEmailConfirmation(CustomerInterface $customer, $redirectU } } catch (MailException $e) { // If we are not able to send a new account email, this should be ignored - $this->logger->logException($e); + $this->logger->critical($e); } } @@ -639,7 +639,7 @@ private function changePasswordForCustomer($customer, $currentPassword, $newPass try { $this->sendPasswordResetNotificationEmail($customer); } catch (MailException $e) { - $this->logger->logException($e); + $this->logger->critical($e); } return true; diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index 926e2078f2746..c280217bcde27 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -270,7 +270,7 @@ public function compactValue($value) $uploader->save($mediaDir->getAbsolutePath($this->_entityTypeCode), $value['name']); $result = $uploader->getUploadedFileName(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Customer/Model/Vat.php b/app/code/Magento/Customer/Model/Vat.php index 0bd3d70b8d2c7..0b895ea65bba3 100644 --- a/app/code/Magento/Customer/Model/Vat.php +++ b/app/code/Magento/Customer/Model/Vat.php @@ -172,7 +172,7 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode = ); if (!extension_loaded('soap')) { - $this->logger->logException(new \Magento\Framework\Model\Exception(__('PHP SOAP extension is required.'))); + $this->logger->critical(new \Magento\Framework\Model\Exception(__('PHP SOAP extension is required.'))); return $gatewayResponse; } diff --git a/app/code/Magento/Customer/Model/Visitor.php b/app/code/Magento/Customer/Model/Visitor.php index 0a41a5ba682cf..642e33c184c5b 100644 --- a/app/code/Magento/Customer/Model/Visitor.php +++ b/app/code/Magento/Customer/Model/Visitor.php @@ -164,7 +164,7 @@ public function saveByRequest($observer) $this->_eventManager->dispatch('visitor_activity_save', ['visitor' => $this]); $this->session->setVisitorData($this->getData()); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return $this; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php index 795726faba28c..f7afe52525f3d 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php @@ -123,7 +123,7 @@ protected function _renderStoreDesigner() } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t load the list of themes.')); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php index 763971b0af06f..75750d2bea18d 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php @@ -77,7 +77,7 @@ public function execute() } $response = ['message' => $successMessage, 'themeId' => $themeCustomization->getId()]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response = ['error' => true, 'message' => __('This theme is not assigned.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php index 2cb0ede931f9c..39c68bb0a40a1 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php @@ -35,9 +35,9 @@ public function execute() $this->messageManager->addSuccess(__('You saved a duplicate copy of this theme in "My Customizations."')); } catch (CoreException $e) { $this->messageManager->addError($e->getMessage()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('You cannot duplicate this theme.')); } $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php index e8955aa585b22..101b7e111574d 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php @@ -23,7 +23,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode([]) ); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php index 14e1134e7a77e..5ff329a13f0f3 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php @@ -154,12 +154,12 @@ public function execute() $this->_view->renderLayout(); } catch (CoreException $e) { $this->messageManager->addException($e, $e->getMessage()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('adminhtml/*/'); return; } catch (\Exception $e) { $this->messageManager->addException($e, __('Sorry, there was an unknown error.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('adminhtml/*/'); return; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php index 6c4695c701be2..2ccd95bbf3f0d 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php @@ -41,7 +41,7 @@ public function execute() $response = ['content' => $this->_view->getLayout()->getOutput()]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response = ['error' => __('Sorry, but we can\'t load the theme list.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php index f690b4b7cfc21..d34e1bc1c58ab 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php @@ -31,9 +31,9 @@ public function execute() $response = ['success' => true]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response = ['error' => true, 'message' => __('This theme is not saved.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php index 108d9298fbb26..1e39c8688dc07 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php @@ -47,7 +47,7 @@ public function execute() } $response = ['message' => $message]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response = ['error' => true, 'message' => __('Unknown error')]; } /** @var $coreHelper \Magento\Core\Helper\Data */ diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php index 899c59803f8fe..07893246c8a8e 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php @@ -28,7 +28,7 @@ public function execute() } $response = ['message' => $message]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response = ['error' => true, 'message' => __('Sorry, there was an unknown error.')]; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php index 9d3e391833605..2515d1ef020c1 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php @@ -22,7 +22,7 @@ public function execute() $this->_forward('jsList'); } catch (\Exception $e) { $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php index f815039bb3a4c..04954eb5fd9f6 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php @@ -24,7 +24,7 @@ public function execute() $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php index 933c7c7546bcb..b63a6c1c064a2 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php @@ -41,14 +41,14 @@ public function execute() $response = ['error' => false, 'content' => $result]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php index a28c14fcc0a80..4e53fd32abeae 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php @@ -50,14 +50,14 @@ public function execute() $response = ['error' => false, 'content' => []]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php index 692a1479a9608..474c114828629 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php @@ -27,10 +27,10 @@ public function execute() $result = ['success' => true]; } catch (CoreException $e) { $result = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php index 6edc4c2dc49c0..0ee26290c8b93 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php @@ -35,10 +35,10 @@ public function execute() ]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We can\'t save the custom css file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php index c9d65e7636cf7..bec9dde0bb052 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php @@ -35,10 +35,10 @@ public function execute() $result = ['success' => true, 'message' => __('We saved the image sizes.')]; } catch (CoreException $e) { $result = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We can\'t save image sizes.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php index d14b8bd6365d4..a3444c0a3f120 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php @@ -31,14 +31,14 @@ public function execute() $response = ['success' => true]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php index 928962e41e0f6..467d7738f7e4b 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php @@ -39,10 +39,10 @@ public function execute() ]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php index 62e7e0922a922..4cb02a7149a09 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php @@ -33,10 +33,10 @@ public function execute() return; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We cannot upload the JS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php index 113765a967d59..c1431963a5b8a 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php @@ -39,14 +39,14 @@ public function execute() } catch (CoreException $e) { $this->messageManager->addError($e->getMessage()); $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php index fa16fc80f141f..5272738b3b14c 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php @@ -44,14 +44,14 @@ public function execute() $response = ['error' => false, 'content' => ['name' => basename($storeLogo->getValue())]]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/Directory/Model/PriceCurrency.php b/app/code/Magento/Directory/Model/PriceCurrency.php index 1768f841a494e..dafb8e1faa682 100644 --- a/app/code/Magento/Directory/Model/PriceCurrency.php +++ b/app/code/Magento/Directory/Model/PriceCurrency.php @@ -135,7 +135,7 @@ protected function getStore($scope = null) $scope = $this->storeManager->getStore($scope); } } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); $scope = $this->storeManager->getStore(); } diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php index 8ef938a8abf6c..0886e2d94abea 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/File.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php @@ -244,7 +244,7 @@ public function compactValue($value) $fileName = $uploader->getUploadedFileName(); $this->getEntity()->setData($attribute->getAttributeCode(), $fileName); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php index cc8e45631d357..95e2cc37a652d 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php @@ -29,7 +29,7 @@ public function execute() $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($template->getData()) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php index 3c0b93101cca5..390449040fa5c 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php @@ -38,7 +38,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting email template data. Please review log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); // save data in session $this->_objectManager->get( 'Magento\Backend\Model\Session' diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 062afab9e2121..23042755a4265 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -615,7 +615,7 @@ public function filter($value) $value = parent::filter($value); } catch (\Exception $e) { $value = ''; - $this->_logger->logException($e); + $this->_logger->critical($e); } return $value; } diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 7da84404894b7..348362a5e7463 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -459,7 +459,7 @@ protected function _doRatesRequest($purpose) $debugData['result'] = $response; } catch (\Exception $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - $this->_logger->logException($e); + $this->_logger->critical($e); } } else { $response = unserialize($response); @@ -774,7 +774,7 @@ protected function _parseXml($xmlContent) throw new \Exception(__('Failed to parse xml document: %1', $xmlContent)); } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return false; } } @@ -1038,7 +1038,7 @@ protected function _getXMLTracking($tracking) $debugData['result'] = $response; } catch (\Exception $e) { $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - $this->_logger->logException($e); + $this->_logger->critical($e); } } else { $response = unserialize($response); diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php index f1a1bece50558..0db9bc133cbbc 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php @@ -41,7 +41,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('Something went wrong during Captcha confirmation.')); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php index 7b25e9e7c05b8..7af24ce927830 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php @@ -48,7 +48,7 @@ public function execute() __('An error has occurred while adding products to google shopping account.'), $e->getMessage() ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); return; } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php index a93e723d3fc5e..86fefea98a0c1 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php @@ -55,7 +55,7 @@ public function execute() 'One or more products were not deleted from google shopping account. Refer to the log file for details.' ) ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); return; } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php index c89198bad9b56..2edcfdf8e124a 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php @@ -23,7 +23,7 @@ public function execute() } $this->messageManager->addSuccess(__('Attribute set mapping was deleted')); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__("We can't delete Attribute Set Mapping.")); } $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php index 9255b7fb80651..becfb35dcaf4c 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php @@ -43,7 +43,7 @@ public function execute() $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Google Content Attributes')); $this->_view->renderLayout(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__("We can't edit Attribute Set Mapping.")); $this->_redirect('adminhtml/*/index'); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php index 2b9bdd82677da..c76f979a21ccd 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php @@ -23,7 +23,7 @@ public function execute() )->toHtml() ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); // just need to output text with error $this->messageManager->addError(__("We can't load attribute sets.")); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php index 443ea921ab780..460df0e645146 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php @@ -27,7 +27,7 @@ public function execute() )->toHtml() ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); // just need to output text with error $this->messageManager->addError(__("We can't load attributes.")); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php index ba47fa1415e1f..db5181519edb3 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php @@ -26,7 +26,7 @@ public function execute() $this->_view->getPage()->getConfig()->getTitle()->prepend(__('New Google Content Attribute Mapping')); $this->_view->renderLayout(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__("We can't create Attribute Set Mapping.")); $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php index 0991036ac84f7..b57f533e8ee11 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php @@ -71,7 +71,7 @@ public function execute() ); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__("We can't save Attribute Set Mapping.")); } $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); diff --git a/app/code/Magento/GoogleShopping/Model/MassOperations.php b/app/code/Magento/GoogleShopping/Model/MassOperations.php index 6215f00c349c7..3e1b53b22fcb6 100644 --- a/app/code/Magento/GoogleShopping/Model/MassOperations.php +++ b/app/code/Magento/GoogleShopping/Model/MassOperations.php @@ -180,7 +180,7 @@ public function addProducts($productIds, $storeId) $e->getMessage() ); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $errors[] = __('The product "%1" hasn\'t been added to Google Content.', $product->getName()); } } @@ -268,7 +268,7 @@ public function synchronizeItems($items) ); $totalFailed++; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $errors[] = __('The item "%1" hasn\'t been updated.', $item->getProduct()->getName()); $totalFailed++; } @@ -329,7 +329,7 @@ public function deleteItems($items) $item->getProduct() ); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $errors[] = __('The item "%1" hasn\'t been deleted.', $item->getProduct()->getName()); } } diff --git a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php index 5d9ffe429bddf..96e19a61b0c3f 100644 --- a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php +++ b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php @@ -74,7 +74,7 @@ public function execute() $product->load($productId); } catch (\Exception $e) { $product->setTypeId(\Magento\Catalog\Model\Product\Type::DEFAULT_TYPE); - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php index d53388494c7a8..cf4d1863bc063 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php @@ -48,7 +48,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('Please correct the data sent.')); } } else { diff --git a/app/code/Magento/ImportExport/Model/Export.php b/app/code/Magento/ImportExport/Model/Export.php index e31fe45df3dda..44223d9e53dde 100644 --- a/app/code/Magento/ImportExport/Model/Export.php +++ b/app/code/Magento/ImportExport/Model/Export.php @@ -94,7 +94,7 @@ protected function _getEntityAdapter() try { $this->_entityAdapter = $this->_entityFactory->create($entities[$this->getEntity()]['model']); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception(__('Please enter a correct entity model')); } if (!$this->_entityAdapter instanceof \Magento\ImportExport\Model\Export\Entity\AbstractEntity && @@ -138,7 +138,7 @@ protected function _getWriter() try { $this->_writer = $this->_exportAdapterFac->create($fileFormats[$this->getFileFormat()]['model']); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception(__('Please enter a correct entity model')); } if (!$this->_writer instanceof \Magento\ImportExport\Model\Export\Adapter\AbstractAdapter) { diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 6b5900c9b8f38..553d4eb345029 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -170,7 +170,7 @@ protected function _getEntityAdapter() try { $this->_entityAdapter = $this->_entityFactory->create($entities[$this->getEntity()]['model']); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception(__('Please enter a correct entity model')); } if (!$this->_entityAdapter instanceof \Magento\ImportExport\Model\Import\Entity\AbstractEntity && diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Delete.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Delete.php index 809323333ca04..cc56199c51476 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Delete.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Delete.php @@ -52,7 +52,7 @@ public function execute() } catch (\Magento\Integration\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } $this->_redirect('*/*/'); } diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Edit.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Edit.php index f7523b7c4bfaf..52254b3be8719 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Edit.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Edit.php @@ -29,7 +29,7 @@ public function execute() $this->_redirect('*/*/'); return; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError(__('Internal error. Check exception log for details.')); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/PermissionsDialog.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/PermissionsDialog.php index 40c30063f9572..8169abfebef32 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/PermissionsDialog.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/PermissionsDialog.php @@ -26,7 +26,7 @@ public function execute() $this->_redirect('*/*/'); return; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError(__('Internal error. Check exception log for details.')); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php index 2f580567c2b88..309b2b8069934 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php @@ -46,7 +46,7 @@ public function execute() $this->_redirect('*/*/'); return; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError(__('Internal error. Check exception log for details.')); $this->_redirect('*/*'); return; @@ -94,7 +94,7 @@ public function execute() $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage())); $this->_redirectOnSaveError(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage())); $this->_redirectOnSaveError(); } diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensDialog.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensDialog.php index 15cd3f85fc90c..f8747958f2cf4 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensDialog.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensDialog.php @@ -53,7 +53,7 @@ public function execute() $this->_redirect('*/*'); return; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError(__('Internal error. Check exception log for details.')); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php index 7ddd5e935f1dd..342b198336c4a 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration/TokensExchange.php @@ -64,7 +64,7 @@ public function execute() $this->_redirect('*/*'); return; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->messageManager->addError(__('Internal error. Check exception log for details.')); $this->_redirect('*/*'); return; diff --git a/app/code/Magento/Integration/Service/V1/AuthorizationService.php b/app/code/Magento/Integration/Service/V1/AuthorizationService.php index 177ba061c5aee..e394eba6f0793 100644 --- a/app/code/Magento/Integration/Service/V1/AuthorizationService.php +++ b/app/code/Magento/Integration/Service/V1/AuthorizationService.php @@ -101,7 +101,7 @@ public function grantPermissions($integrationId, $resources) } $this->_associateResourcesWithRole($role, $resources); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new LocalizedException('Error happened while granting permissions. Check exception log for details.'); } } @@ -122,7 +122,7 @@ public function removePermissions($integrationId) try { $this->_deleteRole($integrationId); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); throw new LocalizedException( 'Error happened while deleting role and permissions. Check exception log for details.' ); diff --git a/app/code/Magento/Integration/Service/V1/Oauth.php b/app/code/Magento/Integration/Service/V1/Oauth.php index c3c9e30e9e0bd..58144ab6b2e51 100644 --- a/app/code/Magento/Integration/Service/V1/Oauth.php +++ b/app/code/Magento/Integration/Service/V1/Oauth.php @@ -220,7 +220,7 @@ public function postToConsumer($consumerId, $endpointUrl) } catch (\Magento\Framework\Oauth\Exception $exception) { throw $exception; } catch (\Exception $exception) { - $this->_logger->logException($exception); + $this->_logger->critical($exception); throw new \Magento\Framework\Oauth\Exception( 'Unable to post data to consumer due to an unexpected error' ); diff --git a/app/code/Magento/Log/Model/Visitor.php b/app/code/Magento/Log/Model/Visitor.php index 079e1dd97759d..ea33af37a292a 100644 --- a/app/code/Magento/Log/Model/Visitor.php +++ b/app/code/Magento/Log/Model/Visitor.php @@ -209,7 +209,7 @@ public function logVisitorActivity($observer) $visitor->setData($this->getData()); } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return $this; } diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Overview.php b/app/code/Magento/Multishipping/Controller/Checkout/Overview.php index a49a02698a299..54d8285274875 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Overview.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Overview.php @@ -41,7 +41,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addException($e, __('We cannot open the overview page.')); $this->_redirect('*/*/billing'); } diff --git a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php index 1549d894a76a4..01b4a42a2a957 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php @@ -105,7 +105,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index c0b2d96137ac3..1a29809a3374c 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -583,7 +583,7 @@ protected function _updateCustomerSubscription($customerId, $subscribe) } } catch (MailException $e) { // If we are not able to send a new account email, this should be ignored - $this->_logger->logException($e); + $this->_logger->critical($e); } } return $this; diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 9b019fd194de8..3f16e68e1a8a6 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -316,7 +316,7 @@ public function uploadAndImport(\Magento\Framework\Object $object) } catch (\Exception $e) { $adapter->rollback(); $stream->close(); - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception(__('Something went wrong while importing table rates.')); } diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php index ae36bdd5b1794..297802cab4907 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We could not cancel the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('paypal/*/view', ['_current' => true]); } diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php index 3d1989a216201..83abbe75ad580 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We could not delete the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('paypal/*/view', ['_current' => true]); } diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php index a89d4e5d01fff..64f34c264a916 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports/Fetch.php @@ -39,13 +39,13 @@ public function execute() $this->messageManager->addError( __("We couldn't fetch reports from '%1@%2'.", $config['username'], $config['hostname']) ); - $this->_logger->logException($e); + $this->_logger->critical($e); } } } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } $this->_redirect('*/*/index'); } diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php index 19498688c58bb..f2e4f00763c95 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php @@ -28,7 +28,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('We couldn\'t cancel the billing agreement.')); } } diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php index a5dae10ca8ad5..6b760dfe90738 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php @@ -38,7 +38,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('We couldn\'t finish the billing agreement wizard.')); } $this->_redirect('*/*/index'); diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php index ed39ccf6763dd..8a688ea974a5a 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php @@ -35,7 +35,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('We couldn\'t start the billing agreement wizard.')); } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php index d6ca046590a6a..2192302b16ea3 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php @@ -36,7 +36,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('Unable to cancel Express Checkout')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('checkout/cart'); diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php index a7e9070526777..6d71fbe17d46e 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php @@ -66,7 +66,7 @@ public function execute() $this->_redirect('*/*/review'); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t place the order.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('*/*/review'); } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php index 1fe28348bb392..0c990b85affbb 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php @@ -34,7 +34,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t process Express Checkout approval.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('checkout/cart'); } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php index c12f7ad74866e..a86e0f6dd0eb5 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php @@ -33,7 +33,7 @@ public function execute() $this->messageManager->addError( __('We can\'t initialize Express Checkout review.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('checkout/cart'); } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php index 9d53989cb02ed..d359572a27f1a 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } if ($isAjax) { $this->getResponse()->setBody( diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php index 16fd60b63923e..a902eb800b29d 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php @@ -61,7 +61,7 @@ public function execute() $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams()); $this->getResponse()->setBody($response); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php index a8f2082a89623..c7330479e086f 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php @@ -81,7 +81,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t start Express Checkout.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('checkout/cart'); diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php index cee6ddc1914de..9f2b22b1f4d20 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php @@ -31,7 +31,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->setBody( '' diff --git a/app/code/Magento/Paypal/Controller/Ipn/Index.php b/app/code/Magento/Paypal/Controller/Ipn/Index.php index 522a7a6fdeac2..e85785023502a 100644 --- a/app/code/Magento/Paypal/Controller/Ipn/Index.php +++ b/app/code/Magento/Paypal/Controller/Ipn/Index.php @@ -53,12 +53,12 @@ public function execute() $data = $this->getRequest()->getPost(); $this->_ipnFactory->create(['data' => $data])->processIpnRequest(); } catch (UnavailableException $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->getResponse()->setHeader('HTTP/1.1', '503 Service Unavailable')->sendResponse(); /** @todo eliminate usage of exit statement */ exit; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $this->getResponse()->setHttpResponseCode(500); } } diff --git a/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php b/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php index 3f93bd1e63ec6..d3e70d96b05b6 100644 --- a/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php +++ b/app/code/Magento/Paypal/Controller/Payflow/SilentPost.php @@ -21,7 +21,7 @@ public function execute() try { $paymentModel->process($data); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Paypal/Model/Api/Nvp.php b/app/code/Magento/Paypal/Model/Api/Nvp.php index e4b4cd53ddf1e..05517f84e7a10 100644 --- a/app/code/Magento/Paypal/Model/Api/Nvp.php +++ b/app/code/Magento/Paypal/Model/Api/Nvp.php @@ -1208,7 +1208,7 @@ public function call($methodName, array $request) // handle transport error if ($http->getErrno()) { - $this->_logger->logException( + $this->_logger->critical( new \Exception( sprintf('PayPal NVP CURL connection error #%s: %s', $http->getErrno(), $http->getError()) ) @@ -1222,7 +1222,7 @@ public function call($methodName, array $request) $http->close(); if (!$this->_validateResponse($methodName, $response)) { - $this->_logger->logException(new \Exception(__("PayPal response hasn't required fields."))); + $this->_logger->critical(new \Exception(__("PayPal response hasn't required fields."))); throw new \Magento\Framework\Model\Exception(__('Something went wrong while processing your order.')); } @@ -1283,7 +1283,7 @@ protected function _handleCallErrors($response) ) : $this->_frameworkExceptionFactory->create( ['message' => $exceptionLogMessage, 'code' => 0] ); - $this->_logger->logException($exception); + $this->_logger->critical($exception); $exception->setMessage(__('PayPal gateway has rejected request. %1', $errorMessages)); diff --git a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php index c58fd46fdf434..11145aeafbf7c 100644 --- a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php +++ b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php @@ -650,7 +650,7 @@ protected function _handleCallErrors($response) if ($response['RESULT'] != self::RESPONSE_CODE_APPROVED) { $message = $response['RESPMSG']; $e = new \Exception(sprintf('PayPal gateway errors: %s.', $message)); - $this->_logger->logException($e); + $this->_logger->critical($e); throw new \Magento\Framework\Model\Exception(__('PayPal gateway rejected the request. %1', $message)); } } diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index f9eff10bbdb2f..06492302db8af 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -391,7 +391,7 @@ public function getCheckoutShortcutImageUrl() $this->_configCacheType->save($pal, $cacheId); } catch (\Exception $e) { $this->_configCacheType->save(self::PAL_CACHE_ID, $cacheId); - $this->_logger->logException($e); + $this->_logger->critical($e); } } } @@ -815,7 +815,7 @@ public function place($token, $shippingMethodCode = null) try { $this->_involveNewCustomer(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index 98b0435f5f265..e68422948a5d7 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -111,11 +111,11 @@ public function fetchReports() try { $reports->fetchAndSave(\Magento\Paypal\Model\Report\Settlement::createConnection($config)); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php index 00d5e13925e95..1f880f78c7816 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php @@ -49,7 +49,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while showing the product views report. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('reports/*/viewed/'); return; } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php index 56ca83847b4b6..fb2c8545ecc81 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php @@ -25,7 +25,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t refresh lifetime statistics.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } if ($this->_getSession()->isFirstPageAfterLogin()) { diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php index c66170a2e787d..967006fb2fb7f 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php @@ -28,7 +28,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t refresh recent statistics.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } if ($this->_getSession()->isFirstPageAfterLogin()) { diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 62b6de167e8b7..1f9723f110769 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -451,7 +451,7 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null) $nextPeriod = $tr['time']; } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return $tzTransitions; diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index 35f6a85f6e829..333d558e746bb 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -195,7 +195,7 @@ protected function _initProduct() ['product' => $product, 'controller_action' => $this] ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return false; } diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index afc92f067d858..535e963d9723d 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -197,7 +197,7 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) } $adapter->commit(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $adapter->rollBack(); } } @@ -233,7 +233,7 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) $adapter->commit(); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); $adapter->rollBack(); } } diff --git a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php index b4b901d6673c2..a217415827c0a 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php @@ -93,7 +93,7 @@ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, Reque try { $this->_auth->login($login, $password); } catch (\Magento\Backend\Model\Auth\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/app/code/Magento/Rss/Controller/Feed.php b/app/code/Magento/Rss/Controller/Feed.php index 889bbd05af316..84fd2cd0fd99c 100644 --- a/app/code/Magento/Rss/Controller/Feed.php +++ b/app/code/Magento/Rss/Controller/Feed.php @@ -86,7 +86,7 @@ protected function auth() $this->customerSession->setCustomerDataAsLoggedIn($customer); $this->customerSession->regenerateId(); } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/app/code/Magento/Rule/Model/Condition/Combine.php b/app/code/Magento/Rule/Model/Condition/Combine.php index 8e9355a4957b2..ec15afef65d71 100644 --- a/app/code/Magento/Rule/Model/Condition/Combine.php +++ b/app/code/Magento/Rule/Model/Condition/Combine.php @@ -215,7 +215,7 @@ public function loadArray($arr, $key = 'conditions') $this->addCondition($condition); $condition->loadArray($conditionArr, $key); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php index 0218e05f67930..489637db0f4c1 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php @@ -24,7 +24,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('You have not canceled the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php index c6aea409518e1..d7325721c57f1 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php @@ -123,7 +123,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_getSession()->setFormData($data); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('Cannot save the credit memo.')); } $this->_redirect('sales/*/new', ['_current' => true]); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php index 39c33005acb51..9d67b4d466e30 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t send the email order.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php index 0d6cd7ddf6224..061872f8f9cee 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php @@ -188,14 +188,14 @@ public function execute() try { $this->invoiceCommentSender->send($invoice, !empty($data['send_email']), $comment); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('We can\'t send the invoice email.')); } if ($shipment) { try { $this->shipmentSender->send($shipment, !empty($data['send_email'])); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('We can\'t send the shipment.')); } } @@ -206,7 +206,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t save the invoice.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/*/new', ['order_id' => $orderId]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php index 6c7215245cd16..5fe6d8e37ddae 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php @@ -49,7 +49,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t update the payment.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php index 20ccd84c08b52..6ff2b7c428bba 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php @@ -26,7 +26,7 @@ public function execute() $this->_redirect('sales/order/index'); return; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('Exception occurred during order load')); $this->_redirect('sales/order/index'); return; diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php index 5a637a1ba4743..ae99743a7e4b0 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t void the payment.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/*/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php index 0377fcf35b615..4399974ea79a9 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php @@ -28,7 +28,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update the transaction details.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('sales/transactions/view', ['_current' => true]); } diff --git a/app/code/Magento/Sales/Model/AbstractNotifier.php b/app/code/Magento/Sales/Model/AbstractNotifier.php index b6e8e45610a0f..d25db83eed095 100644 --- a/app/code/Magento/Sales/Model/AbstractNotifier.php +++ b/app/code/Magento/Sales/Model/AbstractNotifier.php @@ -67,7 +67,7 @@ public function notify(\Magento\Sales\Model\AbstractModel $model) $historyItem->save(); } } catch (Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); return false; } return true; diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index f027b6b36e925..761cb20b95b7a 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -1034,7 +1034,7 @@ public function updateQuoteItems($items) $this->recollectCart(); throw $e; } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } $this->recollectCart(); diff --git a/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php b/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php index c0c32f00441f4..b249f7d7d63d2 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php +++ b/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php @@ -53,7 +53,7 @@ public function send(Order $order) try { $this->orderSender->send($order); } catch (\Magento\Framework\Mail\Exception $exception) { - $this->logger->logException($exception); + $this->logger->critical($exception); $this->messageManager->addWarning( __('You did not email your customer. Please check your email settings.') ); diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php index de4dc93a3a8d0..14fbb20f1ff36 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting the rule. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('sales_rule/*/edit', ['id' => $this->getRequest()->getParam('id')]); return; } diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php index e2bc24c960c9a..4a1b23890b25e 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php @@ -52,7 +52,7 @@ public function execute() $result['error'] = __( 'Something went wrong while generating coupons. Please review the log and try again.' ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } $this->getResponse()->representJson( diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php index 515cfc481f1d2..f0867046d9310 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php @@ -93,7 +93,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while saving the rule data. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_objectManager->get('Magento\Backend\Model\Session')->setPageData($data); $this->_redirect('sales_rule/*/edit', ['id' => $this->getRequest()->getParam('rule_id')]); return; diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php index ac12fa4957763..3ea56bc83abf9 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php @@ -64,7 +64,7 @@ public function execute() $response->setError(true); $response->setMessage($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $response->setError(true); $response->setMessage(__('An error occurred while creating shipping label.')); } diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php index f8223143233c7..453ebde07a0f8 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php @@ -95,7 +95,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('An error occurred while creating shipping label.')); } $this->_redirect( diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php index 075c04dfff05a..006e63beab57b 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php @@ -143,7 +143,7 @@ public function execute() $this->_redirect('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); if ($isNeedCreateLabel) { $responseAjax->setError(true); $responseAjax->setMessage(__('An error occurred while creating shipping label.')); diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php index 9e3677a44a820..84520950e44ae 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php @@ -35,7 +35,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot delete the theme.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } /** * @todo Temporary solution. Theme module should not know about the existence of editor module. diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php index cfe1325536416..909a46b10f3f1 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php @@ -43,7 +43,7 @@ public function execute() } catch (\Exception $e) { $this->messageManager->addException($e, __('File not found: "%1".', $fileId)); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php index 36dde793b45c4..5f2158f8381cb 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php @@ -41,7 +41,7 @@ public function execute() } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot find file')); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php index 86d8996180c19..9305e1eb450c3 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php @@ -40,7 +40,7 @@ public function execute() $this->_redirect('adminhtml/*/'); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot find the theme.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('adminhtml/*/'); } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php index 3eb7a42afd42a..91db9e411166d 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php @@ -69,7 +69,7 @@ public function execute() $redirectBack = true; } catch (\Exception $e) { $this->messageManager->addError('The theme was not saved'); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $redirectBack ? $this->_redirect( 'adminhtml/*/edit', diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php index 6d39f4e303d0c..14035e572415b 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php @@ -23,7 +23,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php index efa49e8f6d603..9c40d81733495 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php @@ -47,7 +47,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the JS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php index d02e1326cc697..da8b2b9c47f75 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php @@ -22,7 +22,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('Sorry, there was an unknown error.')]; - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php index 2f42a5585d2e0..c55290767a4a0 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php @@ -27,7 +27,7 @@ public function execute() DirectoryList::MEDIA ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('core/index/notFound'); } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php index 1ee9b8980537c..55dd0f21069b4 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php @@ -23,7 +23,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode([]) ); diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 7b5181a2be052..64b796628bbd6 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -159,7 +159,7 @@ public function _createThumbnail($source) $image->resize(self::THUMBNAIL_WIDTH, self::THUMBNAIL_HEIGHT); $image->save($this->mediaWriteDirectory->getAbsolutePath($thumbnailPath)); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); return false; } diff --git a/app/code/Magento/Webapi/Controller/ErrorProcessor.php b/app/code/Magento/Webapi/Controller/ErrorProcessor.php index d810a58015c2f..35d44e282e045 100644 --- a/app/code/Magento/Webapi/Controller/ErrorProcessor.php +++ b/app/code/Magento/Webapi/Controller/ErrorProcessor.php @@ -134,7 +134,7 @@ public function maskException(\Exception $exception) //if not in Dev mode, make sure the message and code is masked for unanticipated exceptions if (!$isDevMode) { /** Log information about actual exception */ - $reportId = $this->_logException($exception); + $reportId = $this->_critical($exception); $message = sprintf(self::INTERNAL_SERVER_ERROR_MSG, $reportId); $code = 0; } @@ -166,7 +166,7 @@ public function renderException(\Exception $exception, $httpCode = self::DEFAULT if ($this->_appState->getMode() == State::MODE_DEVELOPER || $exception instanceof \Magento\Webapi\Exception) { $this->render($exception->getMessage(), $exception->getTraceAsString(), $httpCode); } else { - $reportId = $this->_logException($exception); + $reportId = $this->_critical($exception); $this->render( __('Internal Error. Details are available in Magento log file. Report ID: %1', $reportId), 'Trace is not available.', @@ -182,16 +182,16 @@ public function renderException(\Exception $exception, $httpCode = self::DEFAULT * @param \Exception $exception * @return string $reportId */ - protected function _logException(\Exception $exception) + protected function _critical(\Exception $exception) { $exceptionClass = get_class($exception); $reportId = uniqid("webapi-"); $exceptionForLog = new $exceptionClass( - /** Trace is added separately by logException. */ + /** Trace is added separately by critical. */ "Report ID: {$reportId}; Message: {$exception->getMessage()}", $exception->getCode() ); - $this->_logger->logException($exceptionForLog); + $this->_logger->critical($exceptionForLog); return $reportId; } diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php index f756cb5d2b820..d7fd7dd28cca7 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Save.php @@ -44,7 +44,7 @@ public function execute() return; } catch (\Exception $exception) { $this->messageManager->addError($exception->getMessage()); - $this->_logger->logException($exception); + $this->_logger->critical($exception); $this->_redirect('adminhtml/*/edit', ['_current' => true]); return; } diff --git a/app/code/Magento/Wishlist/Controller/Index/Add.php b/app/code/Magento/Wishlist/Controller/Index/Add.php index 93a5a80497f50..0be01dfee728d 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Add.php +++ b/app/code/Magento/Wishlist/Controller/Index/Add.php @@ -127,7 +127,7 @@ public function execute() ); } catch (\Exception $e) { $this->messageManager->addError(__('An error occurred while adding item to wish list.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('*', ['wishlist_id' => $wishlist->getId()]); diff --git a/app/code/Magento/Wishlist/Controller/Index/Configure.php b/app/code/Magento/Wishlist/Controller/Index/Configure.php index d7539cd2046fe..0ff51f62b5784 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Configure.php +++ b/app/code/Magento/Wishlist/Controller/Index/Configure.php @@ -99,7 +99,7 @@ public function execute() return; } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t configure the product.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->_redirect('*'); return; } diff --git a/app/code/Magento/Wishlist/Controller/Index/Update.php b/app/code/Magento/Wishlist/Controller/Index/Update.php index 3b0e7b58f0915..c64ae78ed2255 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Update.php +++ b/app/code/Magento/Wishlist/Controller/Index/Update.php @@ -94,7 +94,7 @@ public function execute() try { $item->delete(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); $this->messageManager->addError(__('Can\'t delete item from wishlist')); } } diff --git a/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php b/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php index cc5893c55da6a..460577765746c 100644 --- a/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php +++ b/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php @@ -99,7 +99,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('An error occurred while updating wish list.')); - $this->_objectManager->get('Magento\Framework\Logger')->logException($e); + $this->_objectManager->get('Magento\Framework\Logger')->critical($e); } $this->_redirect('*/*', ['wishlist_id' => $wishlist->getId()]); } diff --git a/app/code/Magento/Wishlist/Model/ItemCarrier.php b/app/code/Magento/Wishlist/Model/ItemCarrier.php index 07a014b3ff59f..5f843995d111b 100644 --- a/app/code/Magento/Wishlist/Model/ItemCarrier.php +++ b/app/code/Magento/Wishlist/Model/ItemCarrier.php @@ -145,7 +145,7 @@ public function moveAllToCart(Wishlist $wishlist, $qtys) $cart->getQuote()->deleteItem($cartItem); } } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); $messages[] = __('We cannot add this item to your shopping cart.'); } } diff --git a/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php b/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php index 9dfd1848d3d2e..11217c53e37e4 100644 --- a/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php @@ -26,7 +26,7 @@ protected function setUp() parent::setUp(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $loggerMock = $this->getMockBuilder('Magento\\Framework\\Logger')->disableOriginalConstructor()->getMock(); - $loggerMock->expects($this->any())->method('logException')->will($this->returnSelf()); + $loggerMock->expects($this->any())->method('critical')->will($this->returnSelf()); $this->_service = $objectManager->create( 'Magento\Integration\Service\V1\AuthorizationService', [ diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php index e8e777f10bf00..22e3403aa81bc 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php @@ -63,7 +63,7 @@ public function testProcessAjaxPost($originalText, $translatedText, $isPerStore $model->delete(); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Framework\Logger') - ->logException($e); + ->critical($e); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 4ffcca5607537..fe7562f1cb17b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -1927,7 +1927,7 @@ ['setTablePrefix', 'Magento\Framework\App\Magento\Framework\App\Resource', 'Can be passed through constructor only'], ['_debugTimer', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\Logger\LoggerAbstract::startTimer'], ['_debugStat', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\Logger\File::logStats'], - ['_debugException', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\Logger\File::logException'], + ['_debugException', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\Logger\File::critical'], ['_debugWriteToFile', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\Logger\File::log'], ['applyDataUpdates', 'Magento\Framework\Module\Setup', 'Magento\Framework\Module\DataSetup::applyDataUpdates'], ['_installData', 'Magento\Framework\Module\Setup', 'Magento\Framework\Module\DataSetup::_installData'], diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php index c7a5f97851755..7c5a367fbfbcd 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php @@ -142,8 +142,8 @@ public function testTunnelAction503() ->method('create') ->with('Magento\Framework\HTTP\ZendClient') ->will($this->throwException($exceptionMock)); - $loggerMock = $this->getMock('Magento\Framework\Logger', ['logException'], [], '', false); - $loggerMock->expects($this->once())->method('logException')->with($exceptionMock); + $loggerMock = $this->getMock('Magento\Framework\Logger', ['critical'], [], '', false); + $loggerMock->expects($this->once())->method('critical')->with($exceptionMock); $this->_objectManager->expects($this->at(2)) ->method('get') ->with('Magento\Framework\Logger') diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php index 097ab1634ebce..e3aa7a064ac8b 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php @@ -96,7 +96,7 @@ protected function setUp() $this->_logger = $this->getMock( 'Magento\Framework\Logger', - ['addStoreLog', 'log', 'logException'], + ['addStoreLog', 'log', 'critical'], [], '', false @@ -210,7 +210,7 @@ public function getMenuExceptionLoggedDataProvider() public function testGetMenuGenericExceptionIsNotLogged() { - $this->_logger->expects($this->never())->method('logException'); + $this->_logger->expects($this->never())->method('critical'); $this->_menuBuilderMock->expects( $this->exactly(1) diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php index 5a459132fa47c..35235a674e1c1 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php @@ -40,7 +40,7 @@ protected function setUp() $this->_builderMock = $this->getMock('Magento\Backend\Model\Menu\Builder', [], [], '', false); $this->_logger = $this->getMock( 'Magento\Framework\Logger', - ['addStoreLog', 'log', 'logException'], + ['addStoreLog', 'log', 'critical'], [], '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php index 06f8d57b4c979..aea23a0b5ca4d 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php @@ -179,7 +179,7 @@ public function testBuildWhenImpossibleLoadProduct() $this->throwException(new \Exception()) ); $this->loggerMock->expects($this->once()) - ->method('logException'); + ->method('critical'); $this->productMock->expects($this->once()) ->method('setAttributeSetId') ->with(3) diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php index 610278f691b94..f7b481eb9fef0 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php @@ -187,7 +187,7 @@ public function testRenderMsrpEnabled() public function testRenderMsrpNotRegisteredException() { $this->logger->expects($this->once()) - ->method('logException'); + ->method('critical'); $this->priceInfo->expects($this->once()) ->method('getPrice') diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php index 3e0af8d3cc299..ee220db6174da 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php @@ -175,7 +175,7 @@ public function testImportDirectoriesFailureWithoutParent() { $this->directoryMock->expects($this->any())->method('getParentId')->will($this->returnValue(null)); - $this->loggerMock->expects($this->any())->method('logException'); + $this->loggerMock->expects($this->any())->method('critical'); $this->directoryDatabase->importDirectories([]); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/DB/Logger/FileTest.php b/dev/tests/unit/testsuite/Magento/Framework/DB/Logger/FileTest.php index 63c684524727b..e883b622eb368 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/DB/Logger/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/DB/Logger/FileTest.php @@ -128,7 +128,7 @@ public function testLogStatsUnknownType() $this->object->logStats('unknown', 'SELECT something'); } - public function testLogException() + public function testcritical() { $exception = new \Exception('error message'); $expected = "%aEXCEPTION%a'Exception'%a'error message'%a"; @@ -137,6 +137,6 @@ public function testLogException() ->method('write') ->with($this->matches($expected)); - $this->object->logException($exception); + $this->object->critical($exception); } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php index fe0c874a755ff..f83923b7fe301 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php @@ -48,7 +48,7 @@ protected function setUp() $this->_assetJsTwo->expects($this->any())->method('getPath') ->will($this->returnValue('script_two.js')); - $this->_logger = $this->getMock('Magento\Framework\Logger', ['logException'], [], '', false); + $this->_logger = $this->getMock('Magento\Framework\Logger', ['critical'], [], '', false); $this->_mergeStrategy = $this->getMock('Magento\Framework\View\Asset\MergeStrategyInterface'); @@ -100,7 +100,7 @@ public function testConstructorIncompatibleContentTypes() public function testIteratorInterfaceMerge() { $assets = [$this->_assetJsOne, $this->_assetJsTwo]; - $this->_logger->expects($this->never())->method('logException'); + $this->_logger->expects($this->never())->method('critical'); $merged = new \Magento\Framework\View\Asset\Merged( $this->_logger, $this->_mergeStrategy, @@ -135,7 +135,7 @@ public function testIteratorInterfaceMergeFailure() [$this->_assetJsOne, $this->_assetJsTwo, $assetBroken] ); - $this->_logger->expects($this->once())->method('logException')->with($this->identicalTo($mergeError)); + $this->_logger->expects($this->once())->method('critical')->with($this->identicalTo($mergeError)); $expectedResult = [$this->_assetJsOne, $this->_assetJsTwo, $assetBroken]; $this->_assertIteratorEquals($expectedResult, $merged); diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php index 47a209618de0a..c9225cec514c6 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php @@ -210,7 +210,7 @@ public function testMinificationFailed() $this->_asset->expects($this->once())->method('getContent')->will($this->returnValue('content')); $e = new \Exception('test'); $this->_adapter->expects($this->once())->method('minify')->with('content')->will($this->throwException($e)); - $this->_logger->expects($this->once())->method('logException'); + $this->_logger->expects($this->once())->method('critical'); $this->_staticViewDir->expects($this->never())->method('writeFile'); $this->_asset->expects($this->once())->method('getFilePath')->will($this->returnValue('file_path')); $this->_asset->expects($this->once())->method('getContext')->will($this->returnValue('context')); diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php index bb04603a2056e..70bfc7346e0d0 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php @@ -316,7 +316,7 @@ public function testRenderAsset($contentType, $attributes, $ieCondition, $expect ->willReturnArgument(0); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with($exception); $this->urlBuilderMock->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php index ff67933464089..4171f4a6f80a3 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php @@ -73,7 +73,7 @@ public function testExecuteWithException() $this->flag->expects($this->once())->method('lock') ->will($this->throwException(new \Exception('Test exception'))); - $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['logException']) + $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['critical']) ->disableOriginalConstructor()->getMock(); $this->controllerArguments['context']->getObjectManager() ->expects($this->at(2))->method('get')->with('Magento\Framework\Logger') diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php index 78c569bed4f81..df7ff93455d23 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php @@ -67,7 +67,7 @@ public function testExecuteWithException() $this->flag->expects($this->once())->method('lock') ->will($this->throwException(new \Exception('Test exception'))); - $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['logException']) + $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['critical']) ->disableOriginalConstructor()->getMock(); $this->controllerArguments['context']->getObjectManager()->expects($this->at(1))->method('get') ->with('Magento\Framework\Logger') diff --git a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index 4332d4ce46af6..41775ba819331 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -24,7 +24,7 @@ abstract class IntegrationTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_objectManagerMock; - /** @var \Magento\Backend\Model\Layout\Filter\Acl|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Backend\Model\View\Layout\Filter\Acl|\PHPUnit_Framework_MockObject_MockObject */ protected $_layoutFilterMock; /** @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -193,7 +193,7 @@ protected function _createIntegrationController($actionName) [$this->getMock('Magento\Framework\Logger', [], [], '', false)] ); $loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); - $loggerMock->expects($this->any())->method('logException')->will($this->returnSelf()); + $loggerMock->expects($this->any())->method('critical')->will($this->returnSelf()); $menuMock->expects($this->any())->method('getParentItems')->will($this->returnValue([])); $blockMock->expects($this->any())->method('getMenuModel')->will($this->returnValue($menuMock)); $this->_layoutMock->expects($this->any())->method('getMessagesBlock')->will($this->returnValue($blockMock)); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php index d2d4d092c67d3..45d3773694ee3 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php @@ -92,7 +92,7 @@ protected function setUp() $this->_loggerMock = $this->getMockBuilder( 'Magento\Framework\Logger' )->disableOriginalConstructor()->setMethods( - ['logException'] + ['critical'] )->getMock(); $this->_oauthService = new \Magento\Integration\Service\V1\Oauth( diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php index 46c6dbb972fb8..e4234cca30092 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php @@ -41,7 +41,7 @@ public function testIndexActionException() $this->request->expects($this->once())->method('isPost')->will($this->returnValue(true)); $exception = new \Exception(); $this->request->expects($this->once())->method('getPost')->will($this->throwException($exception)); - $this->logger->expects($this->once())->method('logException')->with($this->identicalTo($exception)); + $this->logger->expects($this->once())->method('critical')->with($this->identicalTo($exception)); $this->response->expects($this->once())->method('setHttpResponseCode')->with(500); $this->model->execute(); } diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php index f33ecb18752f4..25921b6990c2e 100644 --- a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php @@ -111,7 +111,7 @@ public function testLoadArray() ->willReturn($this->conditionObjectMock); $this->loggerMock->expects($this->never()) - ->method('logException'); + ->method('critical'); $result = $this->combine->loadArray($array); @@ -138,7 +138,7 @@ public function testLoadArrayLoggerCatchException() ->willThrowException(new \Exception('everything is fine, it is test')); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with(); $result = $this->combine->loadArray($array); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php index b8003b302be29..4091a20ee0f4a 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php @@ -80,7 +80,7 @@ public function testSendFailure() $this->messageManagerMock->expects($this->once()) ->method('addWarning'); $this->loggerMock->expects($this->once()) - ->method('logException'); + ->method('critical'); $this->assertFalse($this->emailSender->send($this->orderMock)); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php index 7eb45cfe80f8c..5be56a6b12ae1 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php @@ -63,7 +63,7 @@ public function setUp() ); $this->loggerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException'], + ['critical'], [], '', false @@ -139,7 +139,7 @@ public function testNotifyException() ->with($this->equalTo($this->creditmemo)) ->will($this->throwException($exception)); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with($this->equalTo($exception)); $this->assertFalse($this->notifier->notify($this->creditmemo)); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php index b838e43bd80b0..416f702e22b0e 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php @@ -63,7 +63,7 @@ public function setUp() ); $this->loggerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException'], + ['critical'], [], '', false @@ -139,7 +139,7 @@ public function testNotifyException() ->with($this->equalTo($this->invoice)) ->will($this->throwException($exception)); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with($this->equalTo($exception)); $this->assertFalse($this->notifier->notify($this->invoice)); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php index c915ea7ec5c55..2478cd0a11ff6 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php @@ -63,7 +63,7 @@ public function setUp() ); $this->loggerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException'], + ['critical'], [], '', false @@ -139,7 +139,7 @@ public function testNotifyException() ->with($this->equalTo($this->order)) ->will($this->throwException($exception)); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with($this->equalTo($exception)); $this->assertFalse($this->notifier->notify($this->order)); } diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php index 4f137b020f68a..42b71d2689ccd 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php @@ -201,7 +201,7 @@ public function testExecuteSaveException() { $logerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException', '__wakeup'], + ['critical', '__wakeup'], [], '', false @@ -215,7 +215,7 @@ public function testExecuteSaveException() ->with($this->shipmentMock, $this->requestMock) ->will($this->returnValue(true)); $this->shipmentMock->expects($this->once())->method('save')->will($this->throwException(new \Exception())); - $logerMock->expects($this->once())->method('logException'); + $logerMock->expects($this->once())->method('critical'); $this->objectManagerMock->expects($this->once()) ->method('get') ->with('Magento\Framework\Logger') diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php index 87df1bed2da2b..866d56eafe8d8 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php @@ -303,7 +303,7 @@ public function testExecuteImageStringFail() $loggerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException'], + ['critical'], [], '', false @@ -335,7 +335,7 @@ public function testExecuteImageStringFail() ->with('Magento\Framework\Logger') ->will($this->returnValue($loggerMock)); $loggerMock->expects($this->once()) - ->method('logException'); + ->method('critical'); $this->requestMock->expects($this->at(4)) ->method('getParam') ->with('shipment_id') diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php index c37df83ef1992..70b25e843215c 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php @@ -63,7 +63,7 @@ public function setUp() ); $this->loggerMock = $this->getMock( 'Magento\Framework\Logger', - ['logException'], + ['critical'], [], '', false @@ -139,7 +139,7 @@ public function testNotifyException() ->with($this->equalTo($this->shipment)) ->will($this->throwException($exception)); $this->loggerMock->expects($this->once()) - ->method('logException') + ->method('critical') ->with($this->equalTo($exception)); $this->assertFalse($this->notifier->notify($this->shipment)); } diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php index 1411c2fc83efc..0fe8d442a1c61 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php @@ -198,7 +198,7 @@ public function testMaskExceptionInDeveloperMode() public function testMaskException($exception, $expectedHttpCode, $expectedMessage, $expectedDetails) { /** Assert that exception was logged. */ - // TODO:MAGETWO-21077 $this->_loggerMock->expects($this->once())->method('logException'); + // TODO:MAGETWO-21077 $this->_loggerMock->expects($this->once())->method('critical'); $maskedException = $this->_errorProcessor->maskException($exception); $this->assertMaskedException( $maskedException, diff --git a/lib/internal/Magento/Framework/App/Area.php b/lib/internal/Magento/Framework/App/Area.php index f37822b1b231b..07f24f415f3ee 100644 --- a/lib/internal/Magento/Framework/App/Area.php +++ b/lib/internal/Magento/Framework/App/Area.php @@ -167,7 +167,7 @@ protected function _applyUserAgentDesignException($request) return true; } } catch (\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); } return false; } diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index e271ecb31206e..07666344ff87d 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -410,7 +410,7 @@ protected function terminate(\Exception $e) if (!$this->objectManager) { throw new \DomainException(); } - $this->objectManager->get('Magento\Framework\Logger')->logException($e); + $this->objectManager->get('Magento\Framework\Logger')->critical($e); } catch (\Exception $e) { $message .= "Could not write error message to log. Please use developer mode to see the message.\n"; } diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 6f5b30cc40c7d..b63ca6b8f22ee 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -444,7 +444,7 @@ public function query($sql, $bind = []) if (!$retry) { $this->logger->logStats(LoggerInterface::TYPE_QUERY, $sql, $bind); - $this->logger->logException($e); + $this->logger->critical($e); throw $e; } } diff --git a/lib/internal/Magento/Framework/DB/Logger/File.php b/lib/internal/Magento/Framework/DB/Logger/File.php index 70ac5f4064a0a..f658077b37685 100644 --- a/lib/internal/Magento/Framework/DB/Logger/File.php +++ b/lib/internal/Magento/Framework/DB/Logger/File.php @@ -72,7 +72,7 @@ public function logStats($type, $sql, $bind = [], $result = null) /** * {@inheritdoc} */ - public function logException(\Exception $e) + public function critical(\Exception $e) { $this->log("EXCEPTION \n$e\n\n"); } diff --git a/lib/internal/Magento/Framework/DB/Logger/Null.php b/lib/internal/Magento/Framework/DB/Logger/Null.php index 7b7dfbb1a791d..8aafe5118ca3c 100644 --- a/lib/internal/Magento/Framework/DB/Logger/Null.php +++ b/lib/internal/Magento/Framework/DB/Logger/Null.php @@ -23,7 +23,7 @@ public function logStats($type, $sql, $bind = [], $result = null) /** * {@inheritdoc} */ - public function logException(\Exception $e) + public function critical(\Exception $e) { } diff --git a/lib/internal/Magento/Framework/DB/LoggerInterface.php b/lib/internal/Magento/Framework/DB/LoggerInterface.php index e937704ac26f6..28b39bc134224 100644 --- a/lib/internal/Magento/Framework/DB/LoggerInterface.php +++ b/lib/internal/Magento/Framework/DB/LoggerInterface.php @@ -43,5 +43,5 @@ public function logStats($type, $sql, $bind = [], $result = null); * @param \Exception $e * @return void */ - public function logException(\Exception $e); + public function critical(\Exception $e); } diff --git a/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php b/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php index 58332f1ef3df9..1096ec6a7f72d 100644 --- a/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php +++ b/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php @@ -27,6 +27,6 @@ public function __construct(\Magento\Framework\Logger $logger) */ public function processException(\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); } } diff --git a/lib/internal/Magento/Framework/Logger.php b/lib/internal/Magento/Framework/Logger.php index b2e848502eab3..c7b70b9239308 100644 --- a/lib/internal/Magento/Framework/Logger.php +++ b/lib/internal/Magento/Framework/Logger.php @@ -69,7 +69,7 @@ public function logDebug($message) * @param \Exception $e * @return void */ - public function logException(\Exception $e) + public function critical(\Exception $e) { $this->log("\n" . $e->__toString(), \Zend_Log::ERR); } diff --git a/lib/internal/Magento/Framework/View/Asset/Merged.php b/lib/internal/Magento/Framework/View/Asset/Merged.php index c91500992fbc5..4da09f0e3d23b 100644 --- a/lib/internal/Magento/Framework/View/Asset/Merged.php +++ b/lib/internal/Magento/Framework/View/Asset/Merged.php @@ -91,7 +91,7 @@ protected function initialize() $this->mergeStrategy->merge($this->assets, $mergedAsset); $this->assets = [$mergedAsset]; } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); } } } diff --git a/lib/internal/Magento/Framework/View/Asset/Minified.php b/lib/internal/Magento/Framework/View/Asset/Minified.php index adc98daa17d04..6ad6c6f151d91 100644 --- a/lib/internal/Magento/Framework/View/Asset/Minified.php +++ b/lib/internal/Magento/Framework/View/Asset/Minified.php @@ -223,7 +223,7 @@ protected function process() try { $this->fillPropertiesByMinifyingAsset(); } catch (\Exception $e) { - $this->logger->logException( + $this->logger->critical( new \Magento\Framework\Exception( 'Could not minify file: ' . $this->originalAsset->getSourceFile(), 0, diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Image.php b/lib/internal/Magento/Framework/View/Design/Theme/Image.php index 1c4f224706f94..4dcad824f2fc0 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/Image.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/Image.php @@ -158,7 +158,7 @@ public function createPreviewImageCopy(ThemeInterface $theme) $this->theme->setPreviewImage($destinationFileName); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { $this->theme->setPreviewImage(null); - $this->logger->logException($e); + $this->logger->critical($e); } return $isCopied; } diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index c270bbd52af27..77eaa40ec95f9 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -743,7 +743,7 @@ public function getViewFileUrl($fileId, array $params = []) $params = array_merge(['_secure' => $this->getRequest()->isSecure()], $params); return $this->_assetRepo->getUrlWithParams($fileId, $params); } catch (\Magento\Framework\Exception $e) { - $this->_logger->logException($e); + $this->_logger->critical($e); return $this->_getNotFoundUrl(); } } diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index 44d388ed1aa77..9bec2a0bd36a4 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -339,7 +339,7 @@ protected function renderAssetHtml($template, $assets) $result .= sprintf($template, $asset->getUrl()); } } catch (\Magento\Framework\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); $result .= sprintf($template, $this->urlBuilder->getUrl('', ['_direct' => 'core/index/notFound'])); } return $result; diff --git a/lib/internal/Magento/Framework/View/Result/Page.php b/lib/internal/Magento/Framework/View/Result/Page.php index c5435e9c4ceb7..e45eee4157ffc 100644 --- a/lib/internal/Magento/Framework/View/Result/Page.php +++ b/lib/internal/Magento/Framework/View/Result/Page.php @@ -327,7 +327,7 @@ protected function getViewFileUrl($fileId, array $params = []) $params = array_merge(['_secure' => $this->request->isSecure()], $params); return $this->assetRepo->getUrlWithParams($fileId, $params); } catch (\Magento\Framework\Exception $e) { - $this->logger->logException($e); + $this->logger->critical($e); return $this->urlBuilder->getUrl('', ['_direct' => 'core/index/notFound']); } } From f2b26d95e9e3274bdb913c7e466df4662bddd076 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 18 Dec 2014 16:25:18 +0200 Subject: [PATCH 03/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - renamed log to info - renamed logFile to debug - renamed logDebug to debug --- app/code/Magento/Backend/Model/Menu.php | 4 +- .../Backend/Model/Menu/Director/Director.php | 2 +- app/code/Magento/Backup/Model/Observer.php | 4 +- app/code/Magento/Core/Model/Layout/Merge.php | 7 +- .../Core/Model/Resource/File/Storage/File.php | 4 +- app/code/Magento/Dhl/Model/Carrier.php | 6 +- app/code/Magento/Fedex/Model/Carrier.php | 6 +- .../ImportExport/Model/AbstractModel.php | 41 +----- .../Magento/ImportExport/Model/Export.php | 4 +- .../Magento/ImportExport/Model/Import.php | 4 +- .../Model/Carrier/Flatrate.php | 6 +- .../Model/Carrier/Freeshipping.php | 6 +- .../OfflineShipping/Model/Carrier/Pickup.php | 6 +- .../Model/Carrier/Tablerate.php | 6 +- .../Model/Carrier/AbstractCarrier.php | 18 +-- .../Model/Carrier/AbstractCarrierOnline.php | 6 +- app/code/Magento/Ups/Model/Carrier.php | 8 +- app/code/Magento/Usps/Model/Carrier.php | 6 +- .../Magento/TestFramework/ErrorLog/Logger.php | 19 +-- .../Model/Menu/Director/DirectorTest.php | 4 +- .../Magento/Backend/Model/MenuTest.php | 8 +- .../Magento/Core/Model/Layout/MergeTest.php | 14 +- .../Framework/Data/Collection/DbTest.php | 4 +- .../Magento/Framework/Message/ManagerTest.php | 20 --- .../Magento/ImportExport/Model/ExportTest.php | 3 +- .../Magento/Tools/View/Deployer/LogTest.php | 2 - .../Magento/Framework/Data/Collection/Db.php | 2 +- .../Image/Adapter/AbstractAdapter.php | 2 +- lib/internal/Magento/Framework/Logger.php | 34 +---- .../Magento/Framework/Logger/Adapter.php | 124 ------------------ .../Magento/Framework/Logger/README.md | 5 - .../Magento/Framework/Message/Manager.php | 2 +- .../Magento/Framework/Module/DataSetup.php | 4 +- .../Framework/View/Element/Template.php | 2 +- .../Framework/View/Layout/Data/Structure.php | 5 +- .../Framework/View/Layout/Generator/Block.php | 2 +- .../View/Layout/ScheduledStructure/Helper.php | 9 +- 37 files changed, 85 insertions(+), 324 deletions(-) delete mode 100644 lib/internal/Magento/Framework/Logger/Adapter.php delete mode 100644 lib/internal/Magento/Framework/Logger/README.md diff --git a/app/code/Magento/Backend/Model/Menu.php b/app/code/Magento/Backend/Model/Menu.php index f70c0b698268b..2851ae2c33899 100644 --- a/app/code/Magento/Backend/Model/Menu.php +++ b/app/code/Magento/Backend/Model/Menu.php @@ -60,7 +60,7 @@ public function add(\Magento\Backend\Model\Menu\Item $item, $parentId = null, $i $index = intval($index); if (!isset($this[$index])) { $this->offsetSet($index, $item); - $this->_logger->logDebug( + $this->_logger->debug( sprintf('Add of item with id %s was processed', $item->getId()), self::LOGGER_KEY ); @@ -126,7 +126,7 @@ public function remove($itemId) if ($item->getId() == $itemId) { unset($this[$key]); $result = true; - $this->_logger->logDebug( + $this->_logger->debug( sprintf('Remove on item with id %s was processed', $item->getId()), self::LOGGER_KEY ); diff --git a/app/code/Magento/Backend/Model/Menu/Director/Director.php b/app/code/Magento/Backend/Model/Menu/Director/Director.php index dc1854a5ddf0a..763495180bfc0 100644 --- a/app/code/Magento/Backend/Model/Menu/Director/Director.php +++ b/app/code/Magento/Backend/Model/Menu/Director/Director.php @@ -24,7 +24,7 @@ protected function _getCommand($data, $logger) { $command = $this->_commandFactory->create($data['type'], ['data' => $data]); if (isset($this->_messagePatterns[$data['type']])) { - $logger->logDebug( + $logger->debug( sprintf($this->_messagePatterns[$data['type']], $command->getId()), \Magento\Backend\Model\Menu::LOGGER_KEY ); diff --git a/app/code/Magento/Backup/Model/Observer.php b/app/code/Magento/Backup/Model/Observer.php index 77d66b929e18c..56cf013ebaa5f 100644 --- a/app/code/Magento/Backup/Model/Observer.php +++ b/app/code/Magento/Backup/Model/Observer.php @@ -139,11 +139,11 @@ public function scheduledBackup() $backupManager->create(); $message = $this->_backupData->getCreateSuccessMessageByType($type); - $this->_logger->log($message); + $this->_logger->info($message); } catch (\Exception $e) { $this->_errors[] = $e->getMessage(); $this->_errors[] = $e->getTrace(); - $this->_logger->log($e->getMessage(), \Zend_Log::ERR); + $this->_logger->info($e->getMessage()); $this->_logger->critical($e); } diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index b703560efd4a5..b23f5e4b2a3cb 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -436,7 +436,7 @@ protected function _validateMergedLayout($cacheId, $layout) $messages = $this->_layoutValidator->getMessages(); //Add first message to exception $message = reset($messages); - $this->_logger->log('Cache file with merged layout: ' . $cacheId . ': ' . $message, \Zend_Log::ERR); + $this->_logger->info('Cache file with merged layout: ' . $cacheId . ': ' . $message); } } return $this; @@ -696,9 +696,8 @@ protected function _logXmlErrors($fileName, $libXmlErrors) $errors[] = "{$error->message} Line: {$error->line}"; } - $this->_logger->log( - sprintf("Theme layout update file '%s' is not valid.\n%s", $fileName, implode("\n", $errors)), - \Zend_Log::ERR + $this->_logger->info( + sprintf("Theme layout update file '%s' is not valid.\n%s", $fileName, implode("\n", $errors)) ); } } diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/File.php b/app/code/Magento/Core/Model/Resource/File/Storage/File.php index c2bb3fadf7567..e605745b2331e 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/File.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/File.php @@ -98,7 +98,7 @@ public function saveDir($dir) try { $this->_filesystem->getDirectoryWrite(DirectoryList::MEDIA)->create($path); } catch (\Exception $e) { - $this->_logger->log($e->getMessage()); + $this->_logger->info($e->getMessage()); throw new \Magento\Framework\Model\Exception( __('Unable to create directory: %1', DirectoryList::MEDIA . '/' . $path) ); @@ -125,7 +125,7 @@ public function saveFile($filePath, $content, $overwrite = false) return true; } } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->_logger->log($e->getMessage()); + $this->_logger->info($e->getMessage()); throw new \Magento\Framework\Model\Exception(__('Unable to save file: %1', $filePath)); } diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index e5dd061c91d47..192050fe5fea0 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -184,7 +184,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -210,7 +210,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, @@ -245,7 +245,7 @@ public function __construct( parent::__construct( $scopeConfig, $rateErrorFactory, - $logAdapterFactory, + $logger, $xmlElFactory, $rateFactory, $rateMethodFactory, diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 348362a5e7463..20930f428c377 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -119,7 +119,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -142,7 +142,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, @@ -165,7 +165,7 @@ public function __construct( parent::__construct( $scopeConfig, $rateErrorFactory, - $logAdapterFactory, + $logger, $xmlElFactory, $rateFactory, $rateMethodFactory, diff --git a/app/code/Magento/ImportExport/Model/AbstractModel.php b/app/code/Magento/ImportExport/Model/AbstractModel.php index ca62620295ef0..9aa76d99cab6c 100644 --- a/app/code/Magento/ImportExport/Model/AbstractModel.php +++ b/app/code/Magento/ImportExport/Model/AbstractModel.php @@ -20,12 +20,6 @@ abstract class AbstractModel extends \Magento\Framework\Object */ protected $_debugMode = false; - /** - * Logger instance - * @var \Magento\Framework\Logger\Adapter - */ - protected $_logInstance; - /** * Fields that should be replaced in debug with '***' * @@ -50,26 +44,18 @@ abstract class AbstractModel extends \Magento\Framework\Object */ protected $_varDirectory; - /** - * @var \Magento\Framework\Logger\AdapterFactory - */ - protected $_adapterFactory; - /** * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Logger\AdapterFactory $adapterFactory * @param array $data */ public function __construct( \Magento\Framework\Logger $logger, \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Logger\AdapterFactory $adapterFactory, array $data = [] ) { $this->_logger = $logger; $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); - $this->_adapterFactory = $adapterFactory; parent::__construct($data); } @@ -87,32 +73,11 @@ public function addLogComment($debugData) } else { $this->_logTrace[] = $debugData; } - if (!$this->_debugMode) { - return $this; - } - if (!$this->_logInstance) { - $dirName = date('Y/m/d/'); - $fileName = join( - '_', - [ - str_replace(':', '-', $this->getRunAt()), - $this->getScheduledOperationId(), - $this->getOperationType(), - $this->getEntity() - ] - ); - $path = 'import_export/' . $dirName; - $this->_varDirectory->create($path); - - $fileName = $path . $fileName . '.log'; - $this->_logInstance = $this->_adapterFactory->create( - ['fileName' => $this->_varDirectory->getAbsolutePath($fileName)] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - ); + if ($this->_debugMode) { + $this->_logger->debug($debugData); } - $this->_logInstance->log($debugData); + return $this; } diff --git a/app/code/Magento/ImportExport/Model/Export.php b/app/code/Magento/ImportExport/Model/Export.php index 44223d9e53dde..29f23a022eafc 100644 --- a/app/code/Magento/ImportExport/Model/Export.php +++ b/app/code/Magento/ImportExport/Model/Export.php @@ -58,7 +58,6 @@ class Export extends \Magento\ImportExport\Model\AbstractModel /** * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig * @param \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory * @param \Magento\ImportExport\Model\Export\Adapter\Factory $exportAdapterFac @@ -67,7 +66,6 @@ class Export extends \Magento\ImportExport\Model\AbstractModel public function __construct( \Magento\Framework\Logger $logger, \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig, \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory, \Magento\ImportExport\Model\Export\Adapter\Factory $exportAdapterFac, @@ -76,7 +74,7 @@ public function __construct( $this->_exportConfig = $exportConfig; $this->_entityFactory = $entityFactory; $this->_exportAdapterFac = $exportAdapterFac; - parent::__construct($logger, $filesystem, $adapterFactory, $data); + parent::__construct($logger, $filesystem, $data); } /** diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 553d4eb345029..88b8226e49887 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -112,7 +112,6 @@ class Import extends \Magento\ImportExport\Model\AbstractModel /** * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Logger\AdapterFactory $adapterFactory * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig @@ -128,7 +127,6 @@ class Import extends \Magento\ImportExport\Model\AbstractModel public function __construct( \Magento\Framework\Logger $logger, \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Logger\AdapterFactory $adapterFactory, \Magento\ImportExport\Helper\Data $importExportData, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\ImportExport\Model\Import\ConfigInterface $importConfig, @@ -152,7 +150,7 @@ public function __construct( $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; - parent::__construct($logger, $filesystem, $adapterFactory, $data); + parent::__construct($logger, $filesystem, $data); } /** diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php index 76e0436d79118..b7cb5714f6442 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php @@ -35,7 +35,7 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -43,14 +43,14 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] ) { $this->_rateResultFactory = $rateResultFactory; $this->_rateMethodFactory = $rateMethodFactory; - parent::__construct($scopeConfig, $rateErrorFactory, $logAdapterFactory, $data); + parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } /** diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 0e9274eb72644..3726bb282e36b 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -36,7 +36,7 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -44,14 +44,14 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] ) { $this->_rateResultFactory = $rateResultFactory; $this->_rateMethodFactory = $rateMethodFactory; - parent::__construct($scopeConfig, $rateErrorFactory, $logAdapterFactory, $data); + parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } /** diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index 16a86670b815c..133816020ee4a 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -30,7 +30,7 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -38,14 +38,14 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] ) { $this->_rateResultFactory = $rateResultFactory; $this->_rateMethodFactory = $rateMethodFactory; - parent::__construct($scopeConfig, $rateErrorFactory, $logAdapterFactory, $data); + parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } /** diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php index 60cb1f3faa317..aa61363567b0d 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php @@ -45,7 +45,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory * @param \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory @@ -54,7 +54,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory, \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory, @@ -63,7 +63,7 @@ public function __construct( $this->_rateResultFactory = $rateResultFactory; $this->_resultMethodFactory = $resultMethodFactory; $this->_tablerateFactory = $tablerateFactory; - parent::__construct($scopeConfig, $rateErrorFactory, $logAdapterFactory, $data); + parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); foreach ($this->getCode('condition_name') as $k => $v) { $this->_conditionNames[] = $k; } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 4cf071e4acab4..7efca7af94521 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -86,26 +86,26 @@ abstract class AbstractCarrier extends \Magento\Framework\Object implements Abst protected $_rateErrorFactory; /** - * @var \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory + * @var \Magento\Framework\Logger */ - protected $_logAdapterFactory; + protected $_logger; /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param array $data */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, array $data = [] ) { parent::__construct($data); $this->_scopeConfig = $scopeConfig; $this->_rateErrorFactory = $rateErrorFactory; - $this->_logAdapterFactory = $logAdapterFactory; + $this->_logger = $logger; } /** @@ -568,13 +568,7 @@ public function isZipCodeRequired($countryId = null) protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logAdapterFactory->create( - ['fileName' => 'shipping_' . $this->getCarrierCode() . '.log'] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - )->log( - $debugData - ); + $this->_logger->log($debugData); } } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index 7337c2a96e146..061e953250e42 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -103,7 +103,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -122,7 +122,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, @@ -147,7 +147,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_directoryData = $directoryData; $this->stockRegistry = $stockRegistry; - parent::__construct($scopeConfig, $rateErrorFactory, $logAdapterFactory, $data); + parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } /** diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 6b72c10d40d7f..733cefd503f78 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -117,7 +117,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -139,7 +139,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, @@ -162,7 +162,7 @@ public function __construct( parent::__construct( $scopeConfig, $rateErrorFactory, - $logAdapterFactory, + $logger, $xmlElFactory, $rateFactory, $rateMethodFactory, @@ -518,7 +518,7 @@ protected function _parseCgiResponse($response) $message = __( 'Sorry, something went wrong. Please try again or contact us and we\'ll try to help.' ); - $this->_logger->log($message . ': ' . $errorTitle); + $this->_logger->info($message . ': ' . $errorTitle); break; case 6: if (in_array($row[3], $allowedMethods)) { diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 14b501c6e3180..11e7aa0a4ef08 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -115,7 +115,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Magento\Framework\Logger $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -137,7 +137,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Magento\Framework\Logger $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, @@ -160,7 +160,7 @@ public function __construct( parent::__construct( $scopeConfig, $rateErrorFactory, - $logAdapterFactory, + $logger, $xmlElFactory, $rateFactory, $rateMethodFactory, diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php index 31f4202d6289a..6cef1344d105f 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php @@ -18,13 +18,8 @@ class Logger extends \Magento\Framework\Logger */ protected $minimumErrorLevel; - /** - * @param \Magento\Framework\Filesystem $filesystem - * @param string $defaultFile - */ - public function __construct(\Magento\Framework\Filesystem $filesystem, $defaultFile = '') + public function __construct() { - parent::__construct($filesystem, $defaultFile); $this->minimumErrorLevel = defined('TESTS_ERROR_LOG_LISTENER_LEVEL') ? TESTS_ERROR_LOG_LISTENER_LEVEL : -1; } @@ -46,16 +41,10 @@ public function getMessages() /** * @param string $message - * @param int $level + * @internal param int $level */ - public function log($message, $level = \Zend_Log::DEBUG) + public function info($message) { - if ($level <= $this->minimumErrorLevel) { - $this->messages[] = [ - 'level' => $level, - 'message' => $message, - ]; - } - parent::log($message, $level); + parent::info($message); } } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php index 35235a674e1c1..452d3d5071fac 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php @@ -40,7 +40,7 @@ protected function setUp() $this->_builderMock = $this->getMock('Magento\Backend\Model\Menu\Builder', [], [], '', false); $this->_logger = $this->getMock( 'Magento\Framework\Logger', - ['addStoreLog', 'log', 'critical'], + ['debug', 'info', 'critical'], [], '', false @@ -75,7 +75,7 @@ public function testDirectWithExistKey() { $config = [['type' => 'update'], ['type' => 'remove'], ['type' => 'added']]; $this->_builderMock->expects($this->at(2))->method('processCommand')->with($this->_commandMock); - $this->_logger->expects($this->at(1))->method('logDebug'); + $this->_logger->expects($this->at(1))->method('debug'); $this->_commandMock->expects($this->at(1))->method('getId'); $this->_model->direct($config, $this->_builderMock, $this->_logger); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php index ade079a7984a9..3812e291ded0e 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php @@ -32,7 +32,7 @@ protected function setUp() $this->_items['item3'] = $this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false); $this->_items['item3']->expects($this->any())->method('getId')->will($this->returnValue('item3')); - $this->_logger = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); + $this->_logger = $this->getMock('Magento\Framework\Logger', ['info'], [], '', false); $this->_model = new \Magento\Backend\Model\Menu($this->_logger); } @@ -50,7 +50,7 @@ public function testAddDoLogAddAction() $this->_logger->expects( $this->once() )->method( - 'log' + 'info' )->with( $this->equalTo(sprintf('Add of item with id %s was processed', $this->_items['item1']->getId())) ); @@ -207,7 +207,7 @@ public function testRemoveDoLogRemoveAction() $this->_logger->expects( $this->once() )->method( - 'log' + 'info' )->with( $this->equalTo(sprintf('Remove on item with id %s was processed', $this->_items['item1']->getId())) ); @@ -335,7 +335,7 @@ public function testNestedLoop() public function testSerialize() { $this->assertNotEmpty($this->_model->serialize()); - $this->_logger->expects($this->once())->method('log'); + $this->_logger->expects($this->once())->method('info'); $this->_model->add($this->_items['item1']); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index df6071a6b64ab..e64c7edb5c8af 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -294,11 +294,8 @@ public function testLoadDbApp() public function testGetFileLayoutUpdatesXml() { $errorString = "Theme layout update file '" . __DIR__ . "/_files/layout/file_wrong.xml' is not valid."; - $this->_logger->expects($this->atLeastOnce())->method('log') - ->with( - $this->stringStartsWith($errorString), - \Zend_Log::ERR - ); + $this->_logger->expects($this->atLeastOnce())->method('info') + ->with($this->stringStartsWith($errorString)); $actualXml = $this->_model->getFileLayoutUpdatesXml(); $this->assertXmlStringEqualsXmlFile(__DIR__ . '/_files/merged.xml', $actualXml->asNiceXml()); @@ -405,11 +402,8 @@ public function testLoadWithInvalidLayout() $messages = $this->_layoutValidator->getMessages(); // Testing error message is logged with logger - $this->_logger->expects($this->once())->method('log') - ->with( - 'Cache file with merged layout: ' . $cacheId . ': ' . array_shift($messages), - \Zend_Log::ERR - ); + $this->_logger->expects($this->once())->method('info') + ->with('Cache file with merged layout: ' . $cacheId . ': ' . array_shift($messages)); $this->_model->load(); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php b/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php index 526254a8ddba1..a261fa3694d93 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php @@ -34,7 +34,7 @@ protected function setUp() $this->entityFactoryMock = $this->getMock( 'Magento\Core\Model\EntityFactory', ['create'], [], '', false ); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); + $this->loggerMock = $this->getMock('Magento\Framework\Logger', ['info'], [], '', false); $this->collection = new \Magento\Framework\Data\Collection\Db( $this->entityFactoryMock, $this->loggerMock, @@ -306,7 +306,7 @@ public function printLogQueryPrintingDataProvider() public function testPrintLogQueryLogging($logQuery, $logFlag, $expectedCalls) { $this->collection->setFlag('log_query', $logFlag); - $this->loggerMock->expects($this->exactly($expectedCalls))->method('log'); + $this->loggerMock->expects($this->exactly($expectedCalls))->method('info'); $this->collection->printLogQuery(false, $logQuery, 'some_query'); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php index 265e3a3197ad5..32e6638df24b5 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Message/ManagerTest.php @@ -29,11 +29,6 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ protected $session; - /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject - */ - protected $logger; - /** * @var \Magento\Framework\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -66,11 +61,6 @@ public function setUp() )->disableOriginalConstructor()->setMethods( ['getData', 'setData'] )->getMock(); - $this->logger = $this->getMockBuilder( - 'Magento\Framework\Logger' - )->setMethods( - ['logFile'] - )->disableOriginalConstructor()->getMock(); $this->eventManager = $this->getMockBuilder( 'Magento\Framework\Event\Manager' )->setMethods( @@ -86,7 +76,6 @@ public function setUp() 'messageFactory' => $this->messageFactory, 'session' => $this->session, 'eventManager' => $this->eventManager, - 'logger' => $this->logger ] ); } @@ -201,15 +190,6 @@ public function testAddException() $this->returnValue($messageError) ); - $this->logger->expects( - $this->atLeastOnce() - )->method( - 'logFile' - )->with( - $this->stringStartsWith($logText), - \Zend_Log::DEBUG - ); - $messageCollection = $this->getMockBuilder( 'Magento\Framework\Message\Collection' )->disableOriginalConstructor()->setMethods( diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php index 582bfb7111443..8b0f5e49a1f65 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php @@ -59,7 +59,6 @@ protected function _getMageImportExportModelExportMock() $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $adapterFactory = $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false); $entityFactory = $this->getMock( 'Magento\ImportExport\Model\Export\Entity\Factory', [], @@ -78,7 +77,7 @@ protected function _getMageImportExportModelExportMock() $mockModelExport = $this->getMock( 'Magento\ImportExport\Model\Export', ['getEntityAdapter', '_getEntityAdapter', '_getWriter'], - [$logger, $filesystem, $adapterFactory, $this->_exportConfigMock, $entityFactory, $exportAdapterFac] + [$logger, $filesystem, $this->_exportConfigMock, $entityFactory, $exportAdapterFac] ); $mockModelExport->expects( $this->any() diff --git a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php index eadc24150ace7..b6368b2c889d6 100644 --- a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php +++ b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php @@ -5,8 +5,6 @@ namespace Magento\Tools\View\Deployer; -use Magento\Tools\View\Deployer\Log; - class LogTest extends \PHPUnit_Framework_TestCase { /** diff --git a/lib/internal/Magento/Framework/Data/Collection/Db.php b/lib/internal/Magento/Framework/Data/Collection/Db.php index 2d756703476d9..5694e470cf06a 100644 --- a/lib/internal/Magento/Framework/Data/Collection/Db.php +++ b/lib/internal/Magento/Framework/Data/Collection/Db.php @@ -709,7 +709,7 @@ public function printLogQuery($printQuery = false, $logQuery = false, $sql = nul */ protected function _logQuery($sql) { - $this->_logger->log(is_null($sql) ? $this->getSelect()->__toString() : $sql); + $this->_logger->info(is_null($sql) ? $this->getSelect()->__toString() : $sql); } /** diff --git a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php index e79cdf57d8a79..29883baa622f4 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php +++ b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php @@ -675,7 +675,7 @@ protected function _prepareDestination($destination = null, $newName = null) try { $this->directoryWrite->create($this->directoryWrite->getRelativePath($destination)); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->logger->log($e->getMessage()); + $this->logger->info($e->getMessage()); throw new \Exception('Unable to write file into directory ' . $destination . '. Access forbidden.'); } } diff --git a/lib/internal/Magento/Framework/Logger.php b/lib/internal/Magento/Framework/Logger.php index c7b70b9239308..bc9b11ab1a566 100644 --- a/lib/internal/Magento/Framework/Logger.php +++ b/lib/internal/Magento/Framework/Logger.php @@ -20,47 +20,25 @@ class Logger * Log a message * * @param string $message - * @param int $level - * @return void + * @internal param int $level */ - public function log($message, $level = \Zend_Log::DEBUG) + public function info($message) { if (is_array($message) || is_object($message)) { $message = print_r($message, true); } - $this->log($message, $level); - } - - /** - * Log a message in specific file - * - * @param string $message - * @param int $level - * @param string $file - * @return void - */ - public function logFile($message, $level = \Zend_Log::DEBUG, $file = '') - { - if (!isset($file)) { - $this->log($message, $level); - } - if (is_array($message) || is_object($message)) { - $message = print_r($message, true); - } - /** @var $logger \Zend_Log */ - $this->log($message, $level, $file); + //$this->log($message, $level); } /** * Log a message with "debug" level * * @param string $message - * @param string $loggerKey * @return void */ - public function logDebug($message) + public function debug($message) { - $this->log($message, \Zend_Log::DEBUG); + $this->info($message); } /** @@ -71,6 +49,6 @@ public function logDebug($message) */ public function critical(\Exception $e) { - $this->log("\n" . $e->__toString(), \Zend_Log::ERR); + $this->info("\n" . $e->__toString()); } } diff --git a/lib/internal/Magento/Framework/Logger/Adapter.php b/lib/internal/Magento/Framework/Logger/Adapter.php deleted file mode 100644 index 404795cde9ba0..0000000000000 --- a/lib/internal/Magento/Framework/Logger/Adapter.php +++ /dev/null @@ -1,124 +0,0 @@ -_logFileName = $fileName; - $this->_logger = $logger; - } - - /** - * Perform forced log data to file - * - * @param mixed $data - * @return $this - */ - public function log($data = null) - { - if ($data === null) { - $data = $this->_data; - } else { - if (!is_array($data)) { - $data = [$data]; - } - } - $data = $this->_filterDebugData($data); - $data['__pid'] = getmypid(); - $this->_logger->logFile($data, \Zend_Log::DEBUG, $this->_logFileName); - return $this; - } - - /** - * Log data setter - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function setData($key, $value = null) - { - if (is_array($key)) { - $this->_data = $key; - } else { - $this->_data[$key] = $value; - } - return $this; - } - - /** - * Setter for private data keys, that should be replaced in debug data with '***' - * - * @param array $keys - * @return $this - */ - public function setFilterDataKeys($keys) - { - if (!is_array($keys)) { - $keys = [$keys]; - } - $this->_debugReplacePrivateDataKeys = $keys; - return $this; - } - - /** - * Recursive filter data by private conventions - * - * @param mixed $debugData - * @return string|array - */ - protected function _filterDebugData($debugData) - { - if (is_array($debugData) && is_array($this->_debugReplacePrivateDataKeys)) { - foreach ($debugData as $key => $value) { - if (in_array($key, $this->_debugReplacePrivateDataKeys)) { - $debugData[$key] = '****'; - } else { - if (is_array($debugData[$key])) { - $debugData[$key] = $this->_filterDebugData($debugData[$key]); - } - } - } - } - return $debugData; - } -} diff --git a/lib/internal/Magento/Framework/Logger/README.md b/lib/internal/Magento/Framework/Logger/README.md deleted file mode 100644 index 09eb8ee4505ef..0000000000000 --- a/lib/internal/Magento/Framework/Logger/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Logger - -**Logger** provides a standard mechanism to log to system and error logs. - -* **Adapter** will filter out debug information. \ No newline at end of file diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 9b94a8ec22e94..4ea6187585b94 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -258,7 +258,7 @@ public function addException(\Exception $exception, $alternativeText, $group = n $exception->getTraceAsString() ); - $this->logger->logFile($message, \Zend_Log::DEBUG); + $this->logger->debug($message); $this->addMessage($this->messageFactory->create(MessageInterface::TYPE_ERROR, $alternativeText), $group); return $this; } diff --git a/lib/internal/Magento/Framework/Module/DataSetup.php b/lib/internal/Magento/Framework/Module/DataSetup.php index 2e2a93ccc93cc..ab81a99648731 100644 --- a/lib/internal/Magento/Framework/Module/DataSetup.php +++ b/lib/internal/Magento/Framework/Module/DataSetup.php @@ -223,9 +223,9 @@ protected function _modifyResourceDb($actionType, $fromVersion, $toVersion) if ($result) { $this->_resource->setDataVersion($this->_resourceName, $file['toVersion']); - $this->_logger->log($fileName); + $this->_logger->info($fileName); } else { - $this->_logger->log("Failed resource setup: {$fileName}"); + $this->_logger->info("Failed resource setup: {$fileName}"); } } catch (\Exception $e) { throw new \Magento\Framework\Exception( diff --git a/lib/internal/Magento/Framework/View/Element/Template.php b/lib/internal/Magento/Framework/View/Element/Template.php index e4cc6b45156f9..83f9c102cf2e3 100644 --- a/lib/internal/Magento/Framework/View/Element/Template.php +++ b/lib/internal/Magento/Framework/View/Element/Template.php @@ -251,7 +251,7 @@ public function fetchView($fileName) $html = $templateEngine->render($this->templateContext, $fileName, $this->_viewVars); } else { $html = ''; - $this->_logger->log("Invalid template file: '{$fileName}'", \Zend_Log::CRIT); + $this->_logger->info("Invalid template file: '{$fileName}'"); } \Magento\Framework\Profiler::stop('TEMPLATE:' . $fileName); diff --git a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php index d9ae103f1620f..641c7ea54374d 100644 --- a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php +++ b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php @@ -108,10 +108,9 @@ public function reorderChildElement($parentName, $childName, $offsetOrSibling, $ if ($childName !== $sibling) { $siblingParentName = $this->getParentId($sibling); if ($parentName !== $siblingParentName) { - $this->logger->log( + $this->logger->info( "Broken reference: the '{$childName}' tries to reorder itself towards '{$sibling}', but " . - "their parents are different: '{$parentName}' and '{$siblingParentName}' respectively.", - \Zend_Log::CRIT + "their parents are different: '{$parentName}' and '{$siblingParentName}' respectively." ); return; } diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index 3e632e331a656..15e7e4b26031e 100644 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -172,7 +172,7 @@ protected function getBlockInstance($block, array $arguments = []) try { $block = $this->blockFactory->createBlock($block, $arguments); } catch (\ReflectionException $e) { - $this->logger->log($e->getMessage()); + $this->logger->info($e->getMessage()); } } if (!$block instanceof \Magento\Framework\View\Element\AbstractBlock) { diff --git a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php index b5b5e51248146..0e5a9253b398e 100644 --- a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php +++ b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php @@ -169,7 +169,7 @@ public function scheduleElement( $data = $scheduledStructure->getStructureElementData($key); // if we have reference container to not existed element if (!isset($row[self::SCHEDULED_STRUCTURE_INDEX_TYPE])) { - $this->logger->log("Broken reference: missing declaration of the element '{$key}'.", \Zend_Log::CRIT); + $this->logger->info("Broken reference: missing declaration of the element '{$key}'."); $scheduledStructure->unsetPathElement($key); $scheduledStructure->unsetStructureElement($key); return; @@ -185,13 +185,12 @@ public function scheduleElement( try { $structure->setAsChild($name, $parentName, $alias); } catch (\Exception $e) { - $this->logger->log($e->getMessage()); + $this->logger->info($e->getMessage()); } } else { - $this->logger->log( + $this->logger->info( "Broken reference: the '{$name}' element cannot be added as child to '{$parentName}', " . - 'because the latter doesn\'t exist', - \Zend_Log::CRIT + 'because the latter doesn\'t exist' ); } } From c78ad80c74c06b4acd5c8faf7fc46078c79104db Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 18 Dec 2014 16:34:32 +0200 Subject: [PATCH 04/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - fixed unit tests --- app/code/Magento/Fedex/Model/Carrier.php | 3 --- app/code/Magento/Ups/Model/Carrier.php | 3 --- dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php | 3 +-- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 20930f428c377..74c42bf547678 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -131,7 +131,6 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry - * @param \Magento\Framework\Logger $logger * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Module\Dir\Reader $configReader * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory @@ -154,7 +153,6 @@ public function __construct( \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, - \Magento\Framework\Logger $logger, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Dir\Reader $configReader, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, @@ -183,7 +181,6 @@ public function __construct( $this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v10.wsdl'; $this->_rateServiceWsdl = $wsdlBasePath . 'RateService_v10.wsdl'; $this->_trackServiceWsdl = $wsdlBasePath . 'TrackService_v5.wsdl'; - $this->_logger = $logger; } /** diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 733cefd503f78..91cf865456536 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -129,7 +129,6 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry - * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\Locale\FormatInterface $localeFormat * @param Config $configHelper * @param array $data @@ -151,12 +150,10 @@ public function __construct( \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, - \Magento\Framework\Logger $logger, \Magento\Framework\Locale\FormatInterface $localeFormat, Config $configHelper, array $data = [] ) { - $this->_logger = $logger; $this->_localeFormat = $localeFormat; $this->configHelper = $configHelper; parent::__construct( diff --git a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php index 1ed68fb871b59..4bb9d7ee7e9a4 100644 --- a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php @@ -77,7 +77,7 @@ function ($price) { 'scopeConfig' => $scopeConfig, 'rateErrorFactory' => $this->getMock('Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory', [], [], '', false), - 'logAdapterFactory' => $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false), + 'logger' => $this->getMock('Magento\Framework\Logger', [], [], '', false), 'xmlElFactory' => $this->getMock('Magento\Shipping\Model\Simplexml\ElementFactory', [], [], '', false), 'rateFactory' => $rateFactory, 'rateMethodFactory' => $rateMethodFactory, @@ -91,7 +91,6 @@ function ($price) { 'currencyFactory' => $this->getMock('Magento\Directory\Model\CurrencyFactory', [], [], '', false), 'directoryData' => $this->getMock('Magento\Directory\Helper\Data', [], [], '', false), 'stockRegistry' => $this->getMock('Magento\CatalogInventory\Model\StockRegistry', [], [], '', false), - 'logger' => $this->getMock('Magento\Framework\Logger', [], [], '', false), 'storeManager' => $storeManager, 'configReader' => $this->getMock('Magento\Framework\Module\Dir\Reader', [], [], '', false), 'productCollectionFactory' => From 1286c6a0361d2f8a54e5fcf02e7d3b0aed9d8d6d Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 19 Dec 2014 11:03:01 +0200 Subject: [PATCH 05/24] MAGETWO-31961: Exception when add configurable product from wishlist into cart(problem with product id and item_id) --- .../layout/wishlist_index_configure.xml | 15 +++++++++++++++ .../Magento/Wishlist/Controller/Index/Cart.php | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml diff --git a/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml new file mode 100644 index 0000000000000..94b9ab8477231 --- /dev/null +++ b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/app/code/Magento/Wishlist/Controller/Index/Cart.php b/app/code/Magento/Wishlist/Controller/Index/Cart.php index e0508e6c0e2ef..27e2885c75377 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Cart.php +++ b/app/code/Magento/Wishlist/Controller/Index/Cart.php @@ -114,7 +114,7 @@ public function execute() $refererUrl = $this->_redirect->getRefererUrl(); if ($refererUrl && ($refererUrl != $this->_objectManager->get('Magento\Framework\UrlInterface') - ->getUrl('*/*/configure/', ['id' => $item->getId()]) + ->getUrl('*/*/configure/', ['id' => $item->getId(), 'product_id' => $item->getProductId()]) ) ) { $redirectUrl = $refererUrl; @@ -126,10 +126,22 @@ public function execute() $this->messageManager->addError(__('This product(s) is out of stock.')); } elseif ($e->getCode() == \Magento\Wishlist\Model\Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) { $this->messageManager->addNotice($e->getMessage()); - $redirectUrl = $this->_url->getUrl('*/*/configure/', ['id' => $item->getId()]); + $redirectUrl = $this->_url->getUrl( + '*/*/configure/', + [ + 'id' => $item->getId(), + 'product_id' => $item->getProductId(), + ] + ); } else { $this->messageManager->addNotice($e->getMessage()); - $redirectUrl = $this->_url->getUrl('*/*/configure/', ['id' => $item->getId()]); + $redirectUrl = $this->_url->getUrl( + '*/*/configure/', + [ + 'id' => $item->getId(), + 'product_id' => $item->getProductId(), + ] + ); } } catch (\Exception $e) { $this->messageManager->addException($e, __('Cannot add item to shopping cart')); From b788e28848a940509bb064266201d94a98312806 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 13:29:28 +0200 Subject: [PATCH 06/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - replace Magento\Framework\Logger to Psr\Log\LoggerInterface --- .../Resource/System/Message/Collection.php | 4 +-- .../Authorization/Model/Acl/AclRetriever.php | 2 +- .../Authorization/Model/Resource/Rules.php | 6 ++--- .../Adminhtml/Authorizenet/Payment/Cancel.php | 4 +-- .../Authorizenet/Payment/Cancel.php | 4 +-- .../Controller/Directpost/Payment.php | 4 +-- .../Authorizenet/Model/Authorizenet.php | 8 +++--- .../Magento/Authorizenet/Model/Directpost.php | 8 +++--- app/code/Magento/Backend/Block/Context.php | 4 +-- .../Backend/Block/Template/Context.php | 4 +-- .../Magento/Backend/Block/Widget/Context.php | 4 +-- .../Controller/Adminhtml/Dashboard/Tunnel.php | 2 +- .../System/Config/System/Storage/Status.php | 2 +- .../Config/System/Storage/Synchronize.php | 2 +- app/code/Magento/Backend/Model/Menu.php | 17 ++++-------- .../Backend/Model/Menu/AbstractDirector.php | 4 +-- .../Magento/Backend/Model/Menu/Config.php | 6 ++--- .../Backend/Model/Menu/Director/Director.php | 9 +++---- .../Magento/Backend/etc/adminhtml/system.xml | 4 +-- app/code/Magento/Backend/i18n/de_DE.csv | 2 +- app/code/Magento/Backend/i18n/en_US.csv | 2 +- app/code/Magento/Backend/i18n/es_ES.csv | 2 +- app/code/Magento/Backend/i18n/fr_FR.csv | 2 +- app/code/Magento/Backend/i18n/nl_NL.csv | 2 +- app/code/Magento/Backend/i18n/pt_BR.csv | 2 +- app/code/Magento/Backend/i18n/zh_CN.csv | 2 +- .../Controller/Adminhtml/Index/Create.php | 4 +-- .../Controller/Adminhtml/Index/Rollback.php | 4 +-- app/code/Magento/Backup/Model/Observer.php | 6 ++--- .../Magento/Bundle/Model/Product/Type.php | 4 +-- .../Magento/Catalog/Block/Product/Context.php | 4 +-- .../Controller/Adminhtml/Category/Move.php | 6 ++--- .../Controller/Adminhtml/Product/Builder.php | 4 +-- .../Adminhtml/Product/Duplicate.php | 2 +- .../Controller/Adminhtml/Product/Save.php | 2 +- .../Catalog/Controller/Category/View.php | 2 +- .../Catalog/Controller/Product/View.php | 2 +- .../Category/Attribute/Backend/Image.php | 6 ++--- .../Model/Product/Type/AbstractType.php | 6 ++--- .../Category/Attribute/Collection.php | 4 +-- .../Resource/Category/Flat/Collection.php | 2 +- .../Collection/AbstractCollection.php | 4 +-- .../Resource/Product/Attribute/Collection.php | 4 +-- .../Model/Resource/Product/Collection.php | 4 +-- .../Product/Compare/Item/Collection.php | 4 +-- .../Resource/Product/Option/Collection.php | 4 +-- .../Magento/Catalog/Model/Resource/Url.php | 6 ++--- .../Model/Export/Product.php | 6 ++--- .../Model/Import/Product.php | 6 ++--- .../Stock/Item/StockItemCriteriaMapper.php | 2 +- .../Adminhtml/Promo/Catalog/ApplyRules.php | 2 +- .../Adminhtml/Promo/Catalog/Delete.php | 2 +- .../Adminhtml/Promo/Catalog/Save.php | 2 +- .../Model/Indexer/IndexBuilder.php | 6 ++--- .../CatalogRule/Model/Resource/Rule.php | 6 ++--- .../Model/Resource/Advanced/Collection.php | 4 +-- .../Model/Resource/Fulltext/Collection.php | 4 +-- .../Model/Resource/Search/Collection.php | 4 +-- .../Centinel/Index/ValidatePaymentData.php | 2 +- app/code/Magento/Centinel/Model/Api.php | 6 ++--- .../Magento/Checkout/Controller/Cart/Add.php | 2 +- .../Checkout/Controller/Cart/Addgroup.php | 2 +- .../Checkout/Controller/Cart/Configure.php | 2 +- .../Checkout/Controller/Cart/CouponPost.php | 2 +- .../Checkout/Controller/Cart/Delete.php | 2 +- .../Controller/Cart/UpdateItemOptions.php | 2 +- .../Checkout/Controller/Cart/UpdatePost.php | 2 +- .../Checkout/Controller/Onepage/SaveOrder.php | 4 +-- .../Controller/Onepage/SavePayment.php | 2 +- .../Magento/Checkout/Model/Type/Onepage.php | 6 ++--- .../V1/Address/Billing/WriteService.php | 2 +- .../V1/Address/Shipping/WriteService.php | 2 +- .../Adminhtml/Wysiwyg/Directive.php | 2 +- .../Model/Resource/Page/Grid/Collection.php | 4 +-- .../Model/Product/Type/Configurable.php | 4 +-- .../Product/Collection/AssociatedProduct.php | 4 +-- .../Configurable/Attribute/Collection.php | 4 +-- .../Magento/Core/Model/File/Storage/File.php | 6 ++--- app/code/Magento/Core/Model/Layout/Merge.php | 6 ++--- app/code/Magento/Core/Model/Observer.php | 6 ++--- .../Core/Model/Resource/Design/Collection.php | 4 +-- .../Core/Model/Resource/File/Storage/File.php | 6 ++--- .../Model/Resource/Layout/Link/Collection.php | 4 +-- .../Resource/Layout/Update/Collection.php | 4 +-- .../Customer/Controller/Account/LoginPost.php | 2 +- .../Controller/Adminhtml/Index/Wishlist.php | 2 +- .../Customer/Model/AccountManagement.php | 2 +- .../Model/Attribute/Data/Postcode.php | 2 +- .../Model/Metadata/Form/AbstractData.php | 6 ++--- .../Customer/Model/Metadata/Form/File.php | 4 +-- .../Customer/Model/Metadata/Form/Postcode.php | 2 +- .../Customer/Model/Metadata/Form/Text.php | 4 +-- .../Model/Resource/Customer/Collection.php | 4 +-- app/code/Magento/Customer/Model/Vat.php | 2 +- .../Adminhtml/System/Design/Editor.php | 2 +- .../Design/Editor/AssignThemeToStore.php | 2 +- .../System/Design/Editor/Duplicate.php | 4 +-- .../System/Design/Editor/Files/TreeJson.php | 2 +- .../Adminhtml/System/Design/Editor/Launch.php | 4 +-- .../System/Design/Editor/LoadThemeList.php | 2 +- .../System/Design/Editor/QuickEdit.php | 4 +-- .../Adminhtml/System/Design/Editor/Revert.php | 2 +- .../Adminhtml/System/Design/Editor/Save.php | 2 +- .../Design/Editor/Tools/DeleteCustomFiles.php | 2 +- .../System/Design/Editor/Tools/JsList.php | 2 +- .../Editor/Tools/RemoveQuickStyleImage.php | 4 +-- .../Design/Editor/Tools/RemoveStoreLogo.php | 4 +-- .../System/Design/Editor/Tools/ReorderJs.php | 4 +-- .../Design/Editor/Tools/SaveCssContent.php | 4 +-- .../Design/Editor/Tools/SaveImageSizing.php | 4 +-- .../Design/Editor/Tools/SaveQuickStyles.php | 4 +-- .../System/Design/Editor/Tools/Upload.php | 4 +-- .../System/Design/Editor/Tools/UploadJs.php | 4 +-- .../Editor/Tools/UploadQuickStyleImage.php | 4 +-- .../Design/Editor/Tools/UploadStoreLogo.php | 4 +-- app/code/Magento/Dhl/Model/Carrier.php | 4 +-- .../Magento/Directory/Model/PriceCurrency.php | 2 +- .../Model/Resource/Country/Collection.php | 4 +-- .../Model/Resource/Region/Collection.php | 4 +-- .../Downloadable/Model/Product/Type.php | 4 +-- .../Eav/Model/Attribute/Data/AbstractData.php | 6 ++--- .../Magento/Eav/Model/Attribute/Data/File.php | 4 +-- .../Magento/Eav/Model/Attribute/Data/Text.php | 4 +-- .../Entity/Collection/AbstractCollection.php | 4 +-- .../Eav/Model/Entity/Setup/Context.php | 4 +-- .../Model/Resource/Attribute/Collection.php | 4 +-- .../Resource/Entity/Attribute/Collection.php | 4 +-- .../Entity/Attribute/Grid/Collection.php | 4 +-- .../Entity/Attribute/Option/Collection.php | 4 +-- .../Resource/Form/Attribute/Collection.php | 4 +-- .../Resource/Form/Fieldset/Collection.php | 2 +- .../Email/Template/DefaultTemplate.php | 2 +- .../Adminhtml/Email/Template/Delete.php | 2 +- .../Magento/Email/Model/Template/Filter.php | 6 ++--- app/code/Magento/Fedex/Model/Carrier.php | 6 ++--- .../Googleshopping/Items/ConfirmCaptcha.php | 2 +- .../Googleshopping/Items/MassAdd.php | 2 +- .../Googleshopping/Items/Refresh.php | 2 +- .../Adminhtml/Googleshopping/Types/Delete.php | 2 +- .../Adminhtml/Googleshopping/Types/Edit.php | 2 +- .../Types/LoadAttributeSets.php | 2 +- .../Googleshopping/Types/LoadAttributes.php | 2 +- .../Googleshopping/Types/NewAction.php | 2 +- .../Adminhtml/Googleshopping/Types/Save.php | 2 +- .../GoogleShopping/Model/MassOperations.php | 6 ++--- .../Model/Resource/Item/Collection.php | 4 +-- .../Magento/GoogleShopping/Model/Service.php | 6 ++--- .../GoogleShopping/Model/Service/Item.php | 4 +-- .../Controller/Adminhtml/Edit/Popup.php | 6 ++--- .../Model/Product/Type/Grouped.php | 4 +-- .../Grouped/AssociatedProductsCollection.php | 4 +-- .../Controller/Adminhtml/Export/Export.php | 2 +- .../ImportExport/Model/AbstractModel.php | 6 ++--- .../Magento/ImportExport/Model/Export.php | 4 +-- .../Magento/ImportExport/Model/Import.php | 4 +-- .../Controller/Adminhtml/Integration.php | 6 ++--- .../Service/V1/AuthorizationService.php | 2 +- .../Magento/Integration/Service/V1/Oauth.php | 6 ++--- .../Resource/Visitor/Online/Collection.php | 4 +-- .../Visitor/Online/Grid/Collection.php | 4 +-- .../Controller/Checkout/Overview.php | 2 +- .../Controller/Checkout/OverviewPost.php | 2 +- .../Model/Resource/Problem/Collection.php | 4 +-- .../Model/Resource/Queue/Collection.php | 4 +-- .../Model/Resource/Subscriber/Collection.php | 4 +-- .../Model/Carrier/Flatrate.php | 4 +-- .../Model/Carrier/Freeshipping.php | 4 +-- .../OfflineShipping/Model/Carrier/Pickup.php | 4 +-- .../Model/Carrier/Tablerate.php | 4 +-- .../Model/Resource/Carrier/Tablerate.php | 6 ++--- app/code/Magento/Ogone/Model/Api.php | 4 +-- .../Payment/Model/Method/AbstractMethod.php | 6 ++--- app/code/Magento/Payment/Model/Method/Cc.php | 10 +++---- .../Magento/Payment/Model/Method/Free.php | 4 +-- .../Adminhtml/Billing/Agreement/Cancel.php | 2 +- .../Adminhtml/Billing/Agreement/Delete.php | 2 +- .../Controller/Adminhtml/Paypal/Reports.php | 6 ++--- .../Controller/Billing/Agreement/Cancel.php | 2 +- .../Billing/Agreement/ReturnWizard.php | 2 +- .../Billing/Agreement/StartWizard.php | 2 +- .../Express/AbstractExpress/Cancel.php | 2 +- .../Express/AbstractExpress/PlaceOrder.php | 2 +- .../Express/AbstractExpress/ReturnAction.php | 2 +- .../Express/AbstractExpress/Review.php | 2 +- .../AbstractExpress/SaveShippingMethod.php | 2 +- .../ShippingOptionsCallback.php | 2 +- .../Express/AbstractExpress/Start.php | 2 +- .../AbstractExpress/UpdateShippingMethods.php | 2 +- .../Magento/Paypal/Controller/Ipn/Index.php | 6 ++--- .../Magento/Paypal/Controller/Payflow.php | 6 ++--- app/code/Magento/Paypal/Model/AbstractIpn.php | 4 +-- .../Magento/Paypal/Model/Api/AbstractApi.php | 12 ++++----- app/code/Magento/Paypal/Model/Api/Nvp.php | 8 +++--- .../Magento/Paypal/Model/Api/PayflowNvp.php | 8 +++--- app/code/Magento/Paypal/Model/Direct.php | 8 +++--- app/code/Magento/Paypal/Model/Express.php | 4 +-- .../Magento/Paypal/Model/Express/Checkout.php | 12 ++++----- app/code/Magento/Paypal/Model/Hostedpro.php | 8 +++--- app/code/Magento/Paypal/Model/Ipn.php | 4 +-- .../Magento/Paypal/Model/Method/Agreement.php | 4 +-- app/code/Magento/Paypal/Model/Observer.php | 6 ++--- .../Magento/Paypal/Model/PayflowExpress.php | 4 +-- app/code/Magento/Paypal/Model/Payflowlink.php | 8 +++--- app/code/Magento/Paypal/Model/Payflowpro.php | 8 +++--- .../Method/Billing/AbstractAgreement.php | 4 +-- .../Resource/Billing/Agreement/Collection.php | 4 +-- app/code/Magento/Paypal/Model/Standard.php | 4 +-- .../Adminhtml/Report/Product/Viewed.php | 2 +- .../Report/Statistics/RefreshLifetime.php | 2 +- .../Report/Statistics/RefreshRecent.php | 2 +- .../Model/Resource/Customer/Collection.php | 4 +-- .../Model/Resource/Order/Collection.php | 4 +-- .../Model/Resource/Product/Collection.php | 4 +-- .../Index/Collection/AbstractCollection.php | 4 +-- .../Resource/Product/Lowstock/Collection.php | 4 +-- .../Model/Resource/Quote/Collection.php | 4 +-- .../Model/Resource/Report/AbstractReport.php | 6 ++--- .../Model/Resource/Report/Product/Viewed.php | 4 +-- .../Report/Product/Viewed/Collection.php | 4 +-- .../Resource/Review/Customer/Collection.php | 4 +-- .../Model/Resource/Wishlist/Collection.php | 4 +-- .../Magento/Review/Controller/Product.php | 6 ++--- .../Magento/Review/Model/Resource/Rating.php | 6 ++--- .../Model/Resource/Rating/Collection.php | 4 +-- .../Model/Resource/Rating/Grid/Collection.php | 4 +-- .../Rating/Option/Vote/Collection.php | 4 +-- .../Model/Resource/Review/Collection.php | 4 +-- .../Resource/Review/Product/Collection.php | 4 +-- .../Resource/Review/Summary/Collection.php | 4 +-- .../Action/Plugin/BackendAuthentication.php | 6 ++--- app/code/Magento/Rss/Controller/Feed.php | 6 ++--- .../Magento/Rule/Model/Condition/Combine.php | 2 +- .../Magento/Rule/Model/Condition/Context.php | 8 +++--- .../Controller/Adminhtml/Order/Cancel.php | 2 +- .../Adminhtml/Order/Creditmemo/Save.php | 2 +- .../Controller/Adminhtml/Order/Email.php | 2 +- .../Adminhtml/Order/Invoice/Save.php | 6 ++--- .../Adminhtml/Order/ReviewPayment.php | 2 +- .../Sales/Controller/Adminhtml/Order/View.php | 2 +- .../Adminhtml/Order/VoidPayment.php | 2 +- .../Adminhtml/Transactions/Fetch.php | 2 +- .../Magento/Sales/Model/AbstractNotifier.php | 4 +-- .../Magento/Sales/Model/AdminOrder/Create.php | 6 ++--- .../Sales/Model/AdminOrder/EmailSender.php | 2 +- .../Magento/Sales/Model/Config/Ordered.php | 6 ++--- .../Sales/Model/Order/CreditmemoNotifier.php | 4 +-- .../Sales/Model/Order/InvoiceNotifier.php | 4 +-- .../Sales/Model/Order/Total/Config/Base.php | 4 +-- .../Magento/Sales/Model/OrderNotifier.php | 4 +-- .../Model/Quote/Address/Total/Collector.php | 4 +-- .../Sales/Model/Resource/Order/Collection.php | 4 +-- .../Creditmemo/Order/Grid/Collection.php | 4 +-- .../Order/Invoice/Orders/Grid/Collection.php | 4 +-- .../Resource/Order/Payment/Collection.php | 4 +-- .../Order/Shipment/Order/Grid/Collection.php | 4 +-- .../Sales/Model/Resource/Order/Status.php | 4 +-- .../Quote/Address/Rate/Collection.php | 4 +-- .../Model/Resource/Quote/Item/Collection.php | 4 +-- .../Resource/Quote/Payment/Collection.php | 4 +-- .../Model/Resource/Report/Bestsellers.php | 4 +-- .../Report/Bestsellers/Collection.php | 4 +-- .../Report/Collection/AbstractCollection.php | 4 +-- .../Report/Invoiced/Collection/Invoiced.php | 4 +-- .../Report/Invoiced/Collection/Order.php | 4 +-- .../Sales/Model/Resource/Report/Order.php | 4 +-- .../Resource/Report/Order/Collection.php | 4 +-- .../Report/Refunded/Collection/Order.php | 4 +-- .../Report/Refunded/Collection/Refunded.php | 4 +-- .../Report/Shipping/Collection/Order.php | 4 +-- .../Report/Shipping/Collection/Shipment.php | 4 +-- .../Sales/Model/Resource/Sale/Collection.php | 2 +- .../Resource/Transaction/Grid/Collection.php | 4 +-- .../Adminhtml/Promo/Quote/Delete.php | 2 +- .../Adminhtml/Promo/Quote/Generate.php | 2 +- .../Controller/Adminhtml/Promo/Quote/Save.php | 2 +- .../Model/Resource/Report/Collection.php | 4 +-- .../SalesRule/Model/Resource/Report/Rule.php | 4 +-- .../Model/Resource/Rule/Collection.php | 4 +-- .../Model/Resource/Query/Collection.php | 4 +-- .../Adminhtml/Order/Shipment/CreateLabel.php | 2 +- .../Adminhtml/Order/Shipment/PrintLabel.php | 2 +- .../Adminhtml/Order/Shipment/Save.php | 2 +- .../Model/Carrier/AbstractCarrier.php | 6 ++--- .../Model/Carrier/AbstractCarrierOnline.php | 4 +-- .../Shipping/Model/ShipmentNotifier.php | 4 +-- .../Resource/Config/Collection/Scoped.php | 4 +-- .../Magento/Store/Model/StorageFactory.php | 2 +- .../Resource/Calculation/Rate/Collection.php | 4 +-- .../Tax/Model/Resource/Report/Collection.php | 4 +-- .../Magento/Tax/Model/Resource/Report/Tax.php | 4 +-- .../Adminhtml/System/Design/Theme/Delete.php | 2 +- .../System/Design/Theme/DownloadCss.php | 2 +- .../System/Design/Theme/DownloadCustomCss.php | 2 +- .../Adminhtml/System/Design/Theme/Edit.php | 2 +- .../Adminhtml/System/Design/Theme/Save.php | 2 +- .../System/Design/Theme/UploadCss.php | 2 +- .../System/Design/Theme/UploadJs.php | 2 +- .../System/Design/Wysiwyg/Files/NewFolder.php | 2 +- .../Design/Wysiwyg/Files/PreviewImage.php | 2 +- .../System/Design/Wysiwyg/Files/TreeJson.php | 2 +- .../Magento/Theme/Model/Wysiwyg/Storage.php | 2 +- app/code/Magento/Ups/Model/Carrier.php | 6 ++--- .../Model/Resource/UrlRewriteCollection.php | 4 +-- app/code/Magento/Usps/Model/Carrier.php | 4 +-- .../Webapi/Controller/ErrorProcessor.php | 6 ++--- .../Controller/Adminhtml/Widget/Instance.php | 6 ++--- .../Magento/Widget/Model/Template/Filter.php | 4 +-- .../Magento/Wishlist/Controller/Index/Add.php | 2 +- .../Wishlist/Controller/Index/Configure.php | 2 +- .../Wishlist/Controller/Index/Update.php | 2 +- .../Controller/Index/UpdateItemOptions.php | 2 +- .../Magento/Wishlist/Model/ItemCarrier.php | 4 +-- .../Model/Resource/Item/Collection.php | 4 +-- .../Model/Resource/Item/Collection/Grid.php | 4 +-- .../Generate/Repository/TableCollection.php | 4 +-- .../Magento/TestFramework/Application.php | 6 ++--- .../TestFramework/ErrorLog/Listener.php | 2 +- .../Magento/TestFramework/ErrorLog/Logger.php | 2 +- .../Magento/Backend/Model/SessionTest.php | 2 +- .../Model/Product/Type/AbstractTypeTest.php | 2 +- .../Customer/Controller/AddressTest.php | 2 +- .../Resource/Db/Collection/AbstractTest.php | 2 +- .../Multishipping/Controller/CheckoutTest.php | 2 +- .../Magento/Paypal/Model/VoidTest.php | 4 +-- .../Magento/Sendfriend/Block/SendTest.php | 2 +- .../Translation/Model/InlineParserTest.php | 2 +- .../Magento/Wishlist/Controller/IndexTest.php | 2 +- .../Test/Legacy/_files/obsolete_classes.php | 6 ++--- .../Legacy/_files/obsolete_namespaces.php | 2 +- .../Legacy/_files/obsolete_properties.php | 2 +- .../Magento/Test/Block/Adminhtml.php | 2 +- .../Model/Acl/AclRetrieverTest.php | 2 +- .../Adminhtml/Dashboard/TunnelTest.php | 4 +-- .../Model/Config/Backend/BaseurlTest.php | 2 +- .../Model/Config/Backend/SecureTest.php | 2 +- .../Model/Config/Source/Admin/PageTest.php | 2 +- .../Backend/Model/Menu/BuilderTest.php | 2 +- .../Magento/Backend/Model/Menu/ConfigTest.php | 10 ++----- .../Model/Menu/Director/DirectorTest.php | 8 +----- .../Model/Menu/Filter/IteratorTest.php | 2 +- .../Magento/Backend/Model/Menu/ItemTest.php | 2 +- .../Magento/Backend/Model/MenuTest.php | 26 +++---------------- .../Magento/Backend/Model/UrlTest.php | 2 +- .../Adminhtml/Product/BuilderTest.php | 2 +- .../Catalog/Model/Product/Type/SimpleTest.php | 2 +- .../Model/Product/Type/VirtualTest.php | 2 +- .../Product/Link/Product/CollectionTest.php | 2 +- .../Product/Option/CollectionTest.php | 4 +-- .../Pricing/Render/FinalPriceBoxTest.php | 4 +-- .../Model/Import/Product/Type/OptionTest.php | 2 +- .../Checkout/Model/Type/OnepageTest.php | 4 +-- .../V1/Address/Billing/WriteServiceTest.php | 2 +- .../Model/Resource/PageCriteriaMapperTest.php | 10 ++----- .../Model/Product/Type/ConfigurableTest.php | 2 +- .../File/Storage/Directory/DatabaseTest.php | 4 +-- .../Core/Model/File/Storage/MediaTest.php | 2 +- .../Magento/Core/Model/Layout/MergeTest.php | 2 +- .../Model/Resource/File/Storage/FileTest.php | 2 +- .../Resource/Layout/Link/CollectionTest.php | 2 +- .../Resource/Layout/Update/CollectionTest.php | 2 +- .../Model/Attribute/Data/PostcodeTest.php | 5 ++-- .../Attribute/Backend/BillingTest.php | 4 +-- .../Attribute/Backend/ShippingTest.php | 4 +-- .../Model/Metadata/Form/AbstractDataTest.php | 4 +-- .../Metadata/Form/AbstractFormTestCase.php | 4 +-- .../Directory/Model/PriceCurrencyTest.php | 3 +-- .../Model/Resource/Country/CollectionTest.php | 2 +- .../Downloadable/Model/Product/TypeTest.php | 2 +- .../Model/Attribute/Data/AbstractDataTest.php | 2 +- .../Eav/Model/Attribute/Data/BooleanTest.php | 2 +- .../Eav/Model/Attribute/Data/DateTest.php | 2 +- .../Eav/Model/Attribute/Data/FileTest.php | 2 +- .../Eav/Model/Attribute/Data/ImageTest.php | 2 +- .../Model/Attribute/Data/MultilineTest.php | 2 +- .../Model/Attribute/Data/MultiselectTest.php | 2 +- .../Eav/Model/Attribute/Data/SelectTest.php | 2 +- .../Eav/Model/Attribute/Data/TextTest.php | 2 +- .../Entity/Attribute/Backend/ArrayTest.php | 2 +- .../Collection/AbstractCollectionTest.php | 4 +-- .../Resource/Attribute/CollectionTest.php | 4 +-- .../Attribute/Option/CollectionTest.php | 4 +-- .../Block/Adminhtml/Template/EditTest.php | 2 +- .../Magento/Fedex/Model/CarrierTest.php | 2 +- .../Magento/Framework/App/BootstrapTest.php | 6 ++--- .../Framework/DB/AbstractMapperTest.php | 10 ++----- .../Magento/Framework/DB/QueryTest.php | 10 ++----- .../Framework/Data/Collection/DbTest.php | 4 +-- .../Model/AbstractExtensibleModelTest.php | 2 +- .../Framework/Model/AbstractModelTest.php | 2 +- .../Db/Collection/AbstractCollectionTest.php | 4 +-- .../Framework/Module/Setup/MigrationTest.php | 4 +-- .../Framework/View/Asset/MergedTest.php | 2 +- .../Framework/View/Asset/MinifiedTest.php | 4 +-- .../Magento/Framework/View/ContextTest.php | 2 +- .../Framework/View/Design/Theme/ImageTest.php | 2 +- .../View/Page/Config/RendererTest.php | 5 ++-- .../Googleshopping/Items/MassAddTest.php | 5 ++-- .../Googleshopping/Items/RefreshTest.php | 5 ++-- .../Model/MassOperationsTest.php | 4 +-- .../Model/Product/Type/GroupedTest.php | 2 +- .../Magento/ImportExport/Model/ExportTest.php | 2 +- .../CollectionByPagesIteratorTest.php | 2 +- .../Controller/Adminhtml/IntegrationTest.php | 4 +-- .../Integration/Helper/Oauth/ConsumerTest.php | 6 ++--- .../Service/V1/AuthorizationServiceTest.php | 2 +- .../Integration/Service/V1/OauthTest.php | 2 +- .../Model/BanktransferTest.php | 2 +- .../Model/CashondeliveryTest.php | 2 +- .../testsuite/Magento/Ogone/Model/ApiTest.php | 2 +- .../Block/Info/ContainerAbstractTest.php | 2 +- .../Magento/Payment/Model/Method/FreeTest.php | 2 +- .../Paypal/Controller/Ipn/IndexTest.php | 4 +-- .../Magento/Paypal/Model/Api/NvpTest.php | 6 ++--- .../Magento/Paypal/Model/IpnTest.php | 4 +-- .../Collection/AbstractCollectionTest.php | 2 +- .../Review/Summary/CollectionTest.php | 4 +-- .../Rule/Model/Condition/CombineTest.php | 4 +-- .../Collection/AbstractCollectionTest.php | 4 +-- .../Sales/Model/AdminOrder/CreateTest.php | 2 +- .../Model/AdminOrder/EmailSenderTest.php | 2 +- .../Model/Order/CreditmemoNotifierTest.php | 8 +----- .../Sales/Model/Order/InvoiceNotifierTest.php | 8 +----- .../Model/Order/Total/Config/BaseTest.php | 4 +-- .../Magento/Sales/Model/OrderNotifierTest.php | 8 +----- .../Order/Status/History/CollectionTest.php | 2 +- .../Model/Resource/Report/CollectionTest.php | 8 +----- .../Order/Shipment/CreateLabelTest.php | 10 ++----- .../Order/Shipment/PrintLabelTest.php | 10 ++----- .../Shipping/Model/ShipmentNotifierTest.php | 8 +----- .../System/Design/Theme/IndexTest.php | 2 +- .../Webapi/Controller/ErrorProcessorTest.php | 4 +-- lib/internal/Magento/Framework/App/Area.php | 6 ++--- .../Magento/Framework/App/Bootstrap.php | 2 +- .../Framework/App/Helper/AbstractHelper.php | 2 +- .../Magento/Framework/App/Helper/Context.php | 8 +++--- .../Magento/Framework/DB/AbstractMapper.php | 2 +- lib/internal/Magento/Framework/DB/Query.php | 2 +- .../Data/AbstractSearchCriteriaBuilder.php | 2 +- .../Magento/Framework/Data/Collection/Db.php | 2 +- .../Image/Adapter/AbstractAdapter.php | 2 +- .../Less/PreProcessor/ErrorHandler.php | 6 ++--- .../Magento/Framework/Message/Manager.php | 2 +- .../Magento/Framework/Model/AbstractModel.php | 2 +- .../Magento/Framework/Model/Context.php | 8 +++--- .../Db/Collection/AbstractCollection.php | 4 +-- .../Magento/Framework/Module/DataSetup.php | 2 +- .../Framework/Module/Setup/Context.php | 8 +++--- .../Magento/Framework/View/Asset/Merged.php | 6 ++--- .../Magento/Framework/View/Asset/Minified.php | 6 ++--- .../Magento/Framework/View/Context.php | 6 ++--- .../Framework/View/Design/Theme/Image.php | 6 ++--- .../Framework/View/Element/AbstractBlock.php | 2 +- .../Framework/View/Element/Context.php | 8 +++--- .../View/Element/Template/Context.php | 8 +++--- .../Framework/View/Layout/Data/Structure.php | 6 ++--- .../Framework/View/Layout/Generator/Block.php | 6 ++--- .../View/Layout/ScheduledStructure/Helper.php | 6 ++--- .../Framework/View/Page/Config/Renderer.php | 6 ++--- 458 files changed, 825 insertions(+), 930 deletions(-) diff --git a/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php b/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php index 230934526fbed..ff450f7379266 100644 --- a/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php +++ b/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php @@ -22,7 +22,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Notification\MessageList $messageList @@ -31,7 +31,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Notification\MessageList $messageList, diff --git a/app/code/Magento/Authorization/Model/Acl/AclRetriever.php b/app/code/Magento/Authorization/Model/Acl/AclRetriever.php index 51bd53b2d3f5b..bbe4491d5cf8f 100644 --- a/app/code/Magento/Authorization/Model/Acl/AclRetriever.php +++ b/app/code/Magento/Authorization/Model/Acl/AclRetriever.php @@ -12,7 +12,7 @@ use Magento\Framework\Acl\Builder as AclBuilder; use Magento\Framework\Exception\AuthorizationException; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Permission tree retriever diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index a89e3e33d1a57..d1f16dbe54a44 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -29,21 +29,21 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_aclBuilder; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Acl\Builder $aclBuilder - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Acl\RootResource $rootResource * @param \Magento\Framework\Acl\CacheInterface $aclCache */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Acl\Builder $aclBuilder, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Acl\RootResource $rootResource, \Magento\Framework\Acl\CacheInterface $aclCache ) { diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php index b0c979f96ef5f..6b0cea21633a2 100644 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php +++ b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Payment/Cancel.php @@ -51,10 +51,10 @@ public function execute() $this->_view ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['error_message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['error_message'] = __('Something went wrong canceling the transactions.'); } diff --git a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php index 72e366c7eb939..4efac0717eccf 100644 --- a/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php +++ b/app/code/Magento/Authorizenet/Controller/Authorizenet/Payment/Cancel.php @@ -50,10 +50,10 @@ public function execute() $this->_view ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['error_message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['error_message'] = __( 'There was an error canceling transactions. Please contact us or try again later.' ); diff --git a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php index 2e34c219ef393..a5e093e23d869 100644 --- a/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Directpost/Payment.php @@ -74,11 +74,11 @@ protected function _responseAction(\Magento\Authorizenet\Helper\HelperInterface $paymentMethod->process($data); $result['success'] = 1; } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['success'] = 0; $result['error_msg'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['success'] = 0; $result['error_msg'] = __('We couldn\'t process your order right now. Please try again later.'); } diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet.php b/app/code/Magento/Authorizenet/Model/Authorizenet.php index 36ff1c26ee846..db9df42b623bb 100644 --- a/app/code/Magento/Authorizenet/Model/Authorizenet.php +++ b/app/code/Magento/Authorizenet/Model/Authorizenet.php @@ -296,8 +296,8 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -315,8 +315,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index cfc9eed47103c..71b481ba5f15d 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -82,8 +82,8 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -107,8 +107,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index 4e7548cde61e9..988a0d22efd58 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -32,7 +32,7 @@ class Context extends \Magento\Framework\View\Element\Context * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -55,7 +55,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index 16e3bc65b5ace..b16288e76d232 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -56,7 +56,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -89,7 +89,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Backend/Block/Widget/Context.php b/app/code/Magento/Backend/Block/Widget/Context.php index 7fd088cb03e0e..549f433d313ec 100644 --- a/app/code/Magento/Backend/Block/Widget/Context.php +++ b/app/code/Magento/Backend/Block/Widget/Context.php @@ -39,7 +39,7 @@ class Context extends \Magento\Backend\Block\Template\Context * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -74,7 +74,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php index f1bd26eedac17..94752f8e1e4ed 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Tunnel.php @@ -68,7 +68,7 @@ public function execute() ->setContents($response->getBody()); return $resultRaw; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $error = __('see error log for details'); $httpCode = 503; } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php index 85a3aa075bf17..fa14e28e5c50e 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Status.php @@ -79,7 +79,7 @@ public function execute() ) && $flagData['timeout_reached']) ) { $this->_objectManager->get( - 'Magento\Framework\Logger' + 'Psr\Log\LoggerInterface' )->critical( new \Magento\Framework\Exception( __('The timeout limit for response from synchronize process was reached.') diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php index f2b70585d7a09..f7f1615bf2593 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage/Synchronize.php @@ -43,7 +43,7 @@ public function execute() try { $this->_getSyncSingleton()->synchronize($storage); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $flag->passError($e); } diff --git a/app/code/Magento/Backend/Model/Menu.php b/app/code/Magento/Backend/Model/Menu.php index 2851ae2c33899..582ab34871e32 100644 --- a/app/code/Magento/Backend/Model/Menu.php +++ b/app/code/Magento/Backend/Model/Menu.php @@ -9,11 +9,6 @@ */ class Menu extends \ArrayObject { - /** - * Name of special logger key for debugging building menu - */ - const LOGGER_KEY = 'menu-debug'; - /** * Path in tree structure * @@ -22,15 +17,15 @@ class Menu extends \ArrayObject protected $_path = ''; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param string $pathInMenuStructure */ - public function __construct(\Magento\Framework\Logger $logger, $pathInMenuStructure = '') + public function __construct(\Psr\Log\LoggerInterface $logger, $pathInMenuStructure = '') { if ($pathInMenuStructure) { $this->_path = $pathInMenuStructure . '/'; @@ -61,8 +56,7 @@ public function add(\Magento\Backend\Model\Menu\Item $item, $parentId = null, $i if (!isset($this[$index])) { $this->offsetSet($index, $item); $this->_logger->debug( - sprintf('Add of item with id %s was processed', $item->getId()), - self::LOGGER_KEY + sprintf('Add of item with id %s was processed', $item->getId()) ); } else { $this->add($item, $parentId, $index + 1); @@ -127,8 +121,7 @@ public function remove($itemId) unset($this[$key]); $result = true; $this->_logger->debug( - sprintf('Remove on item with id %s was processed', $item->getId()), - self::LOGGER_KEY + sprintf('Remove on item with id %s was processed', $item->getId()) ); break; } diff --git a/app/code/Magento/Backend/Model/Menu/AbstractDirector.php b/app/code/Magento/Backend/Model/Menu/AbstractDirector.php index f00a30085e076..fa434a36aa8f4 100644 --- a/app/code/Magento/Backend/Model/Menu/AbstractDirector.php +++ b/app/code/Magento/Backend/Model/Menu/AbstractDirector.php @@ -25,12 +25,12 @@ public function __construct(\Magento\Backend\Model\Menu\Builder\CommandFactory $ * * @param array $config * @param \Magento\Backend\Model\Menu\Builder $builder - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @return void */ abstract public function direct( array $config, \Magento\Backend\Model\Menu\Builder $builder, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ); } diff --git a/app/code/Magento/Backend/Model/Menu/Config.php b/app/code/Magento/Backend/Model/Menu/Config.php index 52b3e0f2ac8e6..19f9c2526a713 100644 --- a/app/code/Magento/Backend/Model/Menu/Config.php +++ b/app/code/Magento/Backend/Model/Menu/Config.php @@ -33,7 +33,7 @@ class Config protected $_menu; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -64,7 +64,7 @@ class Config * @param \Magento\Backend\Model\Menu\Config\Reader $configReader * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\App\State $appState */ @@ -75,7 +75,7 @@ public function __construct( \Magento\Backend\Model\Menu\Config\Reader $configReader, \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\State $appState ) { diff --git a/app/code/Magento/Backend/Model/Menu/Director/Director.php b/app/code/Magento/Backend/Model/Menu/Director/Director.php index 763495180bfc0..ccd4f69f11e9a 100644 --- a/app/code/Magento/Backend/Model/Menu/Director/Director.php +++ b/app/code/Magento/Backend/Model/Menu/Director/Director.php @@ -17,7 +17,7 @@ class Director extends \Magento\Backend\Model\Menu\AbstractDirector * Get command object * * @param array $data command params - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @return \Magento\Backend\Model\Menu\Builder\AbstractCommand */ protected function _getCommand($data, $logger) @@ -25,8 +25,7 @@ protected function _getCommand($data, $logger) $command = $this->_commandFactory->create($data['type'], ['data' => $data]); if (isset($this->_messagePatterns[$data['type']])) { $logger->debug( - sprintf($this->_messagePatterns[$data['type']], $command->getId()), - \Magento\Backend\Model\Menu::LOGGER_KEY + sprintf($this->_messagePatterns[$data['type']], $command->getId()) ); } return $command; @@ -37,10 +36,10 @@ protected function _getCommand($data, $logger) * * @param array $config * @param \Magento\Backend\Model\Menu\Builder $builder - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @return void */ - public function direct(array $config, \Magento\Backend\Model\Menu\Builder $builder, \Magento\Framework\Logger $logger) + public function direct(array $config, \Magento\Backend\Model\Menu\Builder $builder, \Psr\Log\LoggerInterface $logger) { foreach ($config as $data) { $builder->processCommand($this->_getCommand($data, $logger)); diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index 85606547aad08..cabd82f87930b 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -202,12 +202,12 @@ Magento\Backend\Model\Config\Backend\Filename - Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log + Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log Magento\Backend\Model\Config\Backend\Filename - Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log + Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log diff --git a/app/code/Magento/Backend/i18n/de_DE.csv b/app/code/Magento/Backend/i18n/de_DE.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/de_DE.csv +++ b/app/code/Magento/Backend/i18n/de_DE.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/es_ES.csv b/app/code/Magento/Backend/i18n/es_ES.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/es_ES.csv +++ b/app/code/Magento/Backend/i18n/es_ES.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/fr_FR.csv b/app/code/Magento/Backend/i18n/fr_FR.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/fr_FR.csv +++ b/app/code/Magento/Backend/i18n/fr_FR.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/nl_NL.csv b/app/code/Magento/Backend/i18n/nl_NL.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/nl_NL.csv +++ b/app/code/Magento/Backend/i18n/nl_NL.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/pt_BR.csv b/app/code/Magento/Backend/i18n/pt_BR.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/pt_BR.csv +++ b/app/code/Magento/Backend/i18n/pt_BR.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backend/i18n/zh_CN.csv b/app/code/Magento/Backend/i18n/zh_CN.csv index 7a956dbcdcfac..9e12e495d09b7 100644 --- a/app/code/Magento/Backend/i18n/zh_CN.csv +++ b/app/code/Magento/Backend/i18n/zh_CN.csv @@ -504,7 +504,7 @@ Developer,Developer "Translate, blocks and other output caches should be disabled for both frontend and admin inline translations.","Translate, blocks and other output caches should be disabled for both frontend and admin inline translations." "Log Settings","Log Settings" "System Log File Name","System Log File Name" -"Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log","Logging from \Magento\Framework\Logger. File is located in {{base_dir}}/var/log" +"Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log","Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log" "Exceptions Log File Name","Exceptions Log File Name" "JavaScript Settings","JavaScript Settings" "Merge JavaScript Files","Merge JavaScript Files" diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php index ebcf25e8637e9..654697d038df5 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php @@ -86,10 +86,10 @@ public function execute() } catch (\Magento\Framework\Backup\Exception\NotEnoughFreeSpace $e) { $errorMessage = __('You need more free space to create a backup.'); } catch (\Magento\Framework\Backup\Exception\NotEnoughPermissions $e) { - $this->_objectManager->get('Magento\Framework\Logger')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); $errorMessage = __('You need more permissions to create a backup.'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); $errorMessage = __('Something went wrong creating the backup.'); } diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php index 86c130e00757f..c10b5b37c5bf8 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php @@ -122,10 +122,10 @@ public function execute() } catch (\Magento\Framework\Backup\Exception\FtpValidationFailed $e) { $errorMsg = __('Failed to validate FTP'); } catch (\Magento\Framework\Backup\Exception\NotEnoughPermissions $e) { - $this->_objectManager->get('Magento\Framework\Logger')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); $errorMsg = __('Not enough permissions to perform rollback.'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); $errorMsg = __('Failed to rollback'); } diff --git a/app/code/Magento/Backup/Model/Observer.php b/app/code/Magento/Backup/Model/Observer.php index 56cf013ebaa5f..c6e408ce4e937 100644 --- a/app/code/Magento/Backup/Model/Observer.php +++ b/app/code/Magento/Backup/Model/Observer.php @@ -43,7 +43,7 @@ class Observer protected $_coreRegistry = null; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -74,7 +74,7 @@ class Observer /** * @param \Magento\Backup\Helper\Data $backupData * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Backup\Factory $backupFactory @@ -83,7 +83,7 @@ class Observer public function __construct( \Magento\Backup\Helper\Data $backupData, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Backup\Factory $backupFactory, diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index d347baa277fbf..adcd9dd07f48b 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -141,7 +141,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param ProductRepositoryInterface $productRepository * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Catalog\Helper\Data $catalogData @@ -167,7 +167,7 @@ public function __construct( \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Catalog\Helper\Data $catalogData, diff --git a/app/code/Magento/Catalog/Block/Product/Context.php b/app/code/Magento/Catalog/Block/Product/Context.php index 916e5c5fff6c0..14ae9729f3e07 100644 --- a/app/code/Magento/Catalog/Block/Product/Context.php +++ b/app/code/Magento/Catalog/Block/Product/Context.php @@ -83,7 +83,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -122,7 +122,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php index 18eda1abf61a4..8b4683d0fb483 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php @@ -18,7 +18,7 @@ class Move extends \Magento\Catalog\Controller\Adminhtml\Category protected $layoutFactory; /** - * @var \Magento\Framework\Logger $logger + * @var \Psr\Log\LoggerInterface $logger */ protected $logger; @@ -27,14 +27,14 @@ class Move extends \Magento\Catalog\Controller\Adminhtml\Category * @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory * @param \Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory * @param \Magento\Framework\View\LayoutFactory $layoutFactory, - * @param \Magento\Framework\Logger $logger, + * @param \Psr\Log\LoggerInterface $logger, */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\View\Result\RedirectFactory $resultRedirectFactory, \Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { parent::__construct($context, $resultRedirectFactory); $this->resultJsonFactory = $resultJsonFactory; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php index 758084c10e98d..0f712c177e24d 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Builder.php @@ -8,7 +8,7 @@ use Magento\Catalog\Model\ProductFactory; use Magento\Cms\Model\Wysiwyg as WysiwygModel; use Magento\Framework\App\RequestInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Registry; class Builder @@ -19,7 +19,7 @@ class Builder protected $productFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php index 8c9e23a174509..618b90846c501 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Duplicate.php @@ -53,7 +53,7 @@ public function execute() $this->messageManager->addSuccess(__('You duplicated the product.')); $resultRedirect->setPath('catalog/*/edit', ['_current' => true, 'id' => $newProduct->getId()]); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError($e->getMessage()); $resultRedirect->setPath('catalog/*/edit', ['_current' => true]); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php index fe6b003cb26d4..4a7ac5bc14e21 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php @@ -116,7 +116,7 @@ public function execute() $this->_session->setProductData($data); $redirectBack = true; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError($e->getMessage()); $redirectBack = true; } diff --git a/app/code/Magento/Catalog/Controller/Category/View.php b/app/code/Magento/Catalog/Controller/Category/View.php index f256d9ae84f8c..d6db2447de5f1 100644 --- a/app/code/Magento/Catalog/Controller/Category/View.php +++ b/app/code/Magento/Catalog/Controller/Category/View.php @@ -123,7 +123,7 @@ protected function _initCategory() ['category' => $category, 'controller_action' => $this] ); } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); return false; } diff --git a/app/code/Magento/Catalog/Controller/Product/View.php b/app/code/Magento/Catalog/Controller/Product/View.php index 4f06ccc1c8662..de750fd115147 100644 --- a/app/code/Magento/Catalog/Controller/Product/View.php +++ b/app/code/Magento/Catalog/Controller/Product/View.php @@ -111,7 +111,7 @@ public function execute() if ($e->getCode() == $this->viewHelper->ERR_NO_PRODUCT_LOADED) { return $this->noProductRedirect(); } else { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $resultForward = $this->resultForwardFactory->create(); $resultForward->forward('noroute'); return $resultForward; diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 7a23c7247e999..2b3267239255e 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -34,19 +34,19 @@ class Image extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend protected $_fileUploaderFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * Construct * - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\Core\Model\File\UploaderFactory $fileUploaderFactory ) { diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php index 3e14401a39a70..1b9fcdff10fe8 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php @@ -123,7 +123,7 @@ abstract public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $ protected $_eventManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -164,7 +164,7 @@ abstract public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $ * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param ProductRepositoryInterface $productRepository */ public function __construct( @@ -176,7 +176,7 @@ public function __construct( \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository ) { $this->_catalogProductOption = $catalogProductOption; diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php b/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php index bd7a18f5d3d40..8f45e92742438 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php @@ -20,7 +20,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory @@ -30,7 +30,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php index 19cf99775d613..24ba5f442771c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php @@ -9,7 +9,7 @@ use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Model\Resource\Db\AbstractDb; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Store\Model\StoreManagerInterface; /** diff --git a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php index a70a1aa239ccd..996f805d3efc8 100644 --- a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php @@ -28,7 +28,7 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -43,7 +43,7 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php index 5650e22e54352..6183326f86b90 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php @@ -18,7 +18,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory @@ -28,7 +28,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php index 0d5d6565704a0..73b7c3cb603b3 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php @@ -248,7 +248,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -272,7 +272,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 46e9df4738f18..c82e9ed4d6ffc 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -49,7 +49,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -75,7 +75,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php index 645ab02c2ad43..550aa2c1ae5e0 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php @@ -27,7 +27,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory @@ -37,7 +37,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory, diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index d59abd1efead5..eacf7eceddc10 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -49,7 +49,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_rootChildrenIds = []; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -92,7 +92,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Eav\Model\Config $eavConfig * @param Product $productResource * @param \Magento\Catalog\Model\Category $catalogCategory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -100,7 +100,7 @@ public function __construct( \Magento\Eav\Model\Config $eavConfig, Product $productResource, \Magento\Catalog\Model\Category $catalogCategory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index 125fe87f102ea..10d107b6ca0f6 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -139,7 +139,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity protected $_exportConfig; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -200,7 +200,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity * @param \Magento\Eav\Model\Config $config * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Catalog\Model\Resource\Product\Collection $collection * @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig * @param \Magento\Catalog\Model\Resource\ProductFactory $productFactory @@ -218,7 +218,7 @@ public function __construct( \Magento\Eav\Model\Config $config, \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Catalog\Model\Resource\Product\Collection $collection, \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig, \Magento\Catalog\Model\Resource\ProductFactory $productFactory, diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 46cd4b7703ae5..60bcd0528cf20 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -481,7 +481,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity protected $indexerRegistry; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ private $_logger; @@ -520,7 +520,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity * @param \Magento\CatalogInventory\Model\Resource\Stock\ItemFactory $stockResItemFac * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Framework\Stdlib\DateTime $dateTime - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Indexer\Model\IndexerRegistry $indexerRegistry * @param array $data * @throws \Magento\Framework\Model\Exception @@ -555,7 +555,7 @@ public function __construct( \Magento\CatalogInventory\Model\Resource\Stock\ItemFactory $stockResItemFac, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Stdlib\DateTime $dateTime, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Indexer\Model\IndexerRegistry $indexerRegistry, array $data = [] ) { diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/StockItemCriteriaMapper.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/StockItemCriteriaMapper.php index 14c56cf114085..5c67e12811ebf 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/StockItemCriteriaMapper.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/StockItemCriteriaMapper.php @@ -10,7 +10,7 @@ use Magento\Framework\DB\Select; use Magento\Framework\Data\ObjectFactory; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; /** diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php index d93e05df6fc46..3d8804ff6d77c 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/ApplyRules.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($errorMessage . ' ' . $ruleJob->getError()); } } catch (\Exception $e) { - $this->_objectManager->create('Magento\Framework\Logger')->critical($e); + $this->_objectManager->create('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError($errorMessage); } $this->_redirect('catalog_rule/*'); diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php index cf530d0bb75c2..fb7a1fc6b310e 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Delete.php @@ -31,7 +31,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting the rule. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('id')]); return; } diff --git a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php index 828979b6304e5..70f07b81bfb0f 100644 --- a/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php +++ b/app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php @@ -75,7 +75,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while saving the rule data. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_objectManager->get('Magento\Backend\Model\Session')->setPageData($data); $this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('rule_id')]); return; diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 0e5a2e3c3c2a2..9c5cbbedb2b1e 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -31,7 +31,7 @@ class IndexBuilder protected $ruleCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -75,7 +75,7 @@ class IndexBuilder * @param PriceCurrencyInterface $priceCurrency * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Stdlib\DateTime $dateFormat * @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime @@ -87,7 +87,7 @@ public function __construct( PriceCurrencyInterface $priceCurrency, \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Stdlib\DateTime $dateFormat, \Magento\Framework\Stdlib\DateTime\DateTime $dateTime, diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index edc600c5faa05..8d2f50e3fd9f3 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -22,7 +22,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource const SECONDS_IN_DAY = 86400; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -96,7 +96,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\CatalogRule\Helper\Data $catalogRuleData - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param PriceCurrencyInterface $priceCurrency */ @@ -108,7 +108,7 @@ public function __construct( \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\CatalogRule\Helper\Data $catalogRuleData, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime $dateTime, PriceCurrencyInterface $priceCurrency ) { diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php index 397bef86191a7..f8d25720209b3 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -31,7 +31,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -56,7 +56,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 8fcdb929eb637..ef409d3af8530 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -48,7 +48,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -75,7 +75,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php index b5c31a4afac47..2880a05ef4642 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php @@ -34,7 +34,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection impl /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -59,7 +59,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection impl */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php index ca56ba6eafe63..1cb27e4d7b623 100644 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php +++ b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php @@ -27,7 +27,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $result['message'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['message'] = __('Validation failed.'); } $this->getResponse()->representJson( diff --git a/app/code/Magento/Centinel/Model/Api.php b/app/code/Magento/Centinel/Model/Api.php index bb2b990ab7d0f..223b299e43d86 100644 --- a/app/code/Magento/Centinel/Model/Api.php +++ b/app/code/Magento/Centinel/Model/Api.php @@ -215,15 +215,15 @@ class Api extends \Magento\Framework\Object /** * Log adapter factory * - * @var \Magento\Framework\Logger\AdapterFactory + * @var \Psr\Log\LoggerInterface\AdapterFactory */ protected $_logFactory; /** - * @param \Magento\Framework\Logger\AdapterFactory $logFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logFactory * @param array $data */ - public function __construct(\Magento\Framework\Logger\AdapterFactory $logFactory, array $data = []) + public function __construct(\Psr\Log\LoggerInterface\AdapterFactory $logFactory, array $data = []) { $this->_logFactory = $logFactory; parent::__construct($data); diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index d65ce4d25fd8d..64abe026ff2f5 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -134,7 +134,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot add this item to your shopping cart')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_goBack(); } } diff --git a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php index 658864a6afedd..4911ebfd7ff64 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php +++ b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php @@ -31,7 +31,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot add this item to your shopping cart')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_goBack(); } } diff --git a/app/code/Magento/Checkout/Controller/Cart/Configure.php b/app/code/Magento/Checkout/Controller/Cart/Configure.php index 92b2565d72df8..99fd6f1823074 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Configure.php +++ b/app/code/Magento/Checkout/Controller/Cart/Configure.php @@ -71,7 +71,7 @@ public function execute() return $resultPage; } catch (\Exception $e) { $this->messageManager->addError(__('We cannot configure the product.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_goBack(); return; } diff --git a/app/code/Magento/Checkout/Controller/Cart/CouponPost.php b/app/code/Magento/Checkout/Controller/Cart/CouponPost.php index e9eea809d94a1..4bb72d37daeab 100644 --- a/app/code/Magento/Checkout/Controller/Cart/CouponPost.php +++ b/app/code/Magento/Checkout/Controller/Cart/CouponPost.php @@ -103,7 +103,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot apply the coupon code.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_goBack(); diff --git a/app/code/Magento/Checkout/Controller/Cart/Delete.php b/app/code/Magento/Checkout/Controller/Cart/Delete.php index a22b198f81336..0e57262dd2590 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Delete.php +++ b/app/code/Magento/Checkout/Controller/Cart/Delete.php @@ -20,7 +20,7 @@ public function execute() $this->cart->removeItem($id)->save(); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot remove the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } $defaultUrl = $this->_objectManager->create('Magento\Framework\UrlInterface')->getUrl('*/*'); diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php index afdedd5cf203d..7cc5528e1a445 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php @@ -83,7 +83,7 @@ public function execute() } } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot update the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_goBack(); } $this->_redirect('*/*'); diff --git a/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php b/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php index ab836be0630ee..314755827a759 100644 --- a/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php +++ b/app/code/Magento/Checkout/Controller/Cart/UpdatePost.php @@ -56,7 +56,7 @@ protected function _updateShoppingCart() ); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot update the shopping cart.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } diff --git a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php index 42161ccd2f73e..1fa75bfe5cc22 100644 --- a/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php +++ b/app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php @@ -63,7 +63,7 @@ public function execute() $result['goto_section'] = 'payment'; $result['update_section'] = ['name' => 'payment-method', 'html' => $this->_getPaymentMethodsHtml()]; } catch (\Magento\Framework\Model\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( @@ -91,7 +91,7 @@ public function execute() $this->getOnepage()->getCheckout()->setUpdateSection(null); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( diff --git a/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php b/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php index 01b590b734582..28e561ecaa531 100644 --- a/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php +++ b/app/code/Magento/Checkout/Controller/Onepage/SavePayment.php @@ -56,7 +56,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $result['error'] = $e->getMessage(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $result['error'] = __('Unable to set Payment Method'); } $this->getResponse()->representJson( diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index d4fb6787fc8d1..ec1ea9cafb054 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -51,7 +51,7 @@ class Onepage protected $_helper; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -168,7 +168,7 @@ class Onepage * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Checkout\Helper\Data $helper * @param \Magento\Customer\Model\Url $customerUrl - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -196,7 +196,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Checkout\Helper\Data $helper, \Magento\Customer\Model\Url $customerUrl, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php b/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php index eda52bc6725e9..2a5e12158c6f3 100644 --- a/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php +++ b/app/code/Magento/Checkout/Service/V1/Address/Billing/WriteService.php @@ -9,7 +9,7 @@ use Magento\Sales\Model\Quote\AddressFactory; use Magento\Sales\Model\QuoteRepository; use Magento\Framework\Exception\InputException; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** Quote billing address write service object. */ class WriteService implements WriteServiceInterface diff --git a/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php b/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php index 233779fb691ce..779e20019107a 100644 --- a/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php +++ b/app/code/Magento/Checkout/Service/V1/Address/Shipping/WriteService.php @@ -6,7 +6,7 @@ use Magento\Framework\Exception\InputException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** Quote shipping address write service object. */ class WriteService implements WriteServiceInterface diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index a6d90682ca49a..956bf2f97193e 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -28,7 +28,7 @@ public function execute() } catch (\Exception $e) { $image->open($this->_objectManager->get('Magento\Cms\Model\Wysiwyg\Config')->getSkinImagePlaceholderUrl()); $response->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/Cms/Model/Resource/Page/Grid/Collection.php b/app/code/Magento/Cms/Model/Resource/Page/Grid/Collection.php index d0610198550f7..4c97a28717c47 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Grid/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Grid/Collection.php @@ -27,7 +27,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -36,7 +36,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php index 688d04e2f09d1..961e7861f02ae 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php @@ -163,7 +163,7 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param ProductRepositoryInterface $productRepository * @param \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory * @param \Magento\Eav\Model\EntityFactory $entityFactory @@ -187,7 +187,7 @@ public function __construct( \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository, \Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory $typeConfigurableFactory, \Magento\Eav\Model\EntityFactory $entityFactory, diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php index 3a6ea1b12da6a..c9c9e020bd551 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Collection/AssociatedProduct.php @@ -40,7 +40,7 @@ class AssociatedProduct extends \Magento\Catalog\Model\Resource\Product\Collecti /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -67,7 +67,7 @@ class AssociatedProduct extends \Magento\Catalog\Model\Resource\Product\Collecti */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute/Collection.php index 7ccbfe16b5922..2d8efc12b7a3e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute/Collection.php @@ -66,7 +66,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -79,7 +79,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Core/Model/File/Storage/File.php b/app/code/Magento/Core/Model/File/Storage/File.php index 7917ade47ef4a..66ac32332d005 100644 --- a/app/code/Magento/Core/Model/File/Storage/File.php +++ b/app/code/Magento/Core/Model/File/Storage/File.php @@ -50,18 +50,18 @@ class File protected $_errors = []; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Core\Helper\File\Storage\Database $storageHelper * @param \Magento\Core\Helper\File\Media $mediaHelper * @param \Magento\Core\Model\Resource\File\Storage\File $fileUtility */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Core\Helper\File\Storage\Database $storageHelper, \Magento\Core\Helper\File\Media $mediaHelper, \Magento\Core\Model\Resource\File\Storage\File $fileUtility diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index b23f5e4b2a3cb..7b643b265fe9c 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -113,7 +113,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface protected $_layoutValidator; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -143,7 +143,7 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface * @param \Magento\Framework\App\State $appState * @param \Magento\Framework\Cache\FrontendInterface $cache * @param \Magento\Core\Model\Layout\Update\Validator $validator - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\View\Design\ThemeInterface $theme Non-injectable theme instance * @param string $cacheSuffix @@ -157,7 +157,7 @@ public function __construct( \Magento\Framework\App\State $appState, \Magento\Framework\Cache\FrontendInterface $cache, \Magento\Core\Model\Layout\Update\Validator $validator, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\View\Design\ThemeInterface $theme = null, $cacheSuffix = '' diff --git a/app/code/Magento/Core/Model/Observer.php b/app/code/Magento/Core/Model/Observer.php index b8a6713dee912..9f67373accaa2 100644 --- a/app/code/Magento/Core/Model/Observer.php +++ b/app/code/Magento/Core/Model/Observer.php @@ -44,7 +44,7 @@ class Observer protected $_registration; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -55,7 +55,7 @@ class Observer * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param Theme\Registration $registration - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool, @@ -64,7 +64,7 @@ public function __construct( \Magento\Framework\App\Config\ReinitableConfigInterface $config, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Core\Model\Theme\Registration $registration, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_cacheFrontendPool = $cacheFrontendPool; $this->_currentTheme = $design->getDesignTheme(); diff --git a/app/code/Magento/Core/Model/Resource/Design/Collection.php b/app/code/Magento/Core/Model/Resource/Design/Collection.php index 05c1d98f23ef5..4d0f641ead44f 100644 --- a/app/code/Magento/Core/Model/Resource/Design/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Design/Collection.php @@ -16,7 +16,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -25,7 +25,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/File.php b/app/code/Magento/Core/Model/Resource/File/Storage/File.php index e605745b2331e..74e1eb3c16bdb 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/File.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/File.php @@ -17,15 +17,15 @@ class File protected $_filesystem; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Logger $log + * @param \Psr\Log\LoggerInterface $log */ - public function __construct(\Magento\Framework\Filesystem $filesystem, \Magento\Framework\Logger $log) + public function __construct(\Magento\Framework\Filesystem $filesystem, \Psr\Log\LoggerInterface $log) { $this->_logger = $log; $this->_filesystem = $filesystem; diff --git a/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php b/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php index 0669794c3c750..926b672c14aba 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php @@ -15,7 +15,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac protected $dateTime; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -25,7 +25,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php b/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php index 01a14102107d7..3254d1aa0022b 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php @@ -30,7 +30,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -39,7 +39,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Customer/Controller/Account/LoginPost.php b/app/code/Magento/Customer/Controller/Account/LoginPost.php index ad470d2b4e3ea..e409febe60fdb 100644 --- a/app/code/Magento/Customer/Controller/Account/LoginPost.php +++ b/app/code/Magento/Customer/Controller/Account/LoginPost.php @@ -159,7 +159,7 @@ public function execute() $this->_getSession()->setUsername($login['username']); } catch (\Exception $e) { // PA DSS violation: this exception log can disclose customer password - // $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + // $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('There was an error validating the login and password.')); } } else { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php index 854fdfa6e0a52..c0b15e0b43675 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Wishlist.php @@ -23,7 +23,7 @@ public function execute() try { $this->_objectManager->create('Magento\Wishlist\Model\Item')->load($itemId)->delete(); } catch (\Exception $exception) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($exception); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($exception); } } diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index 6e9e80e9d4a65..d1c565944b73a 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -25,7 +25,7 @@ use Magento\Framework\Exception\State\ExpiredException; use Magento\Framework\Exception\State\InputMismatchException; use Magento\Framework\Exception\State\InvalidTransitionException; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Mail\Exception as MailException; use Magento\Framework\Mail\Template\TransportBuilder; use Magento\Framework\Math\Random; diff --git a/app/code/Magento/Customer/Model/Attribute/Data/Postcode.php b/app/code/Magento/Customer/Model/Attribute/Data/Postcode.php index f492c92be48d7..489c138cef5ad 100644 --- a/app/code/Magento/Customer/Model/Attribute/Data/Postcode.php +++ b/app/code/Magento/Customer/Model/Attribute/Data/Postcode.php @@ -8,7 +8,7 @@ use Magento\Eav\Model\AttributeDataFactory; use Magento\Framework\App\RequestInterface; use Magento\Framework\Locale\ResolverInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Stdlib\DateTime\TimezoneInterface as MagentoTimezone; /** diff --git a/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php b/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php index b7f66440bf4df..e5c0978f14030 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/AbstractData.php @@ -57,7 +57,7 @@ abstract class AbstractData protected $_localeResolver; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -78,7 +78,7 @@ abstract class AbstractData /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param string|int|bool $value @@ -87,7 +87,7 @@ abstract class AbstractData */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute, \Magento\Framework\Locale\ResolverInterface $localeResolver, $value, diff --git a/app/code/Magento/Customer/Model/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index c280217bcde27..2d8f7a9b78f9e 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -44,7 +44,7 @@ class File extends AbstractData /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param null $value @@ -57,7 +57,7 @@ class File extends AbstractData */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute, \Magento\Framework\Locale\ResolverInterface $localeResolver, $value, diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php b/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php index 8cd0d39d0ead8..531f59819281b 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Postcode.php @@ -8,7 +8,7 @@ use Magento\Customer\Model\Metadata\ElementFactory; use Magento\Directory\Helper\Data as DirectoryHelper; use Magento\Framework\Locale\ResolverInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Stdlib\DateTime\TimezoneInterface as MagentoTimezone; /** diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Text.php b/app/code/Magento/Customer/Model/Metadata/Form/Text.php index b9aa53407860c..34802ae362c81 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Text.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Text.php @@ -17,7 +17,7 @@ class Text extends AbstractData /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param string $value @@ -27,7 +27,7 @@ class Text extends AbstractData */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute, \Magento\Framework\Locale\ResolverInterface $localeResolver, $value, diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php index ab1f24796f95b..dfd228083a10e 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php @@ -28,7 +28,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -44,7 +44,7 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Customer/Model/Vat.php b/app/code/Magento/Customer/Model/Vat.php index 0b895ea65bba3..de7be3cc6061c 100644 --- a/app/code/Magento/Customer/Model/Vat.php +++ b/app/code/Magento/Customer/Model/Vat.php @@ -5,7 +5,7 @@ namespace Magento\Customer\Model; use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Store\Model\ScopeInterface; /** diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php index f7afe52525f3d..c412dc0c274d1 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor.php @@ -123,7 +123,7 @@ protected function _renderStoreDesigner() } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t load the list of themes.')); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php index 75750d2bea18d..f5083bc5691f0 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/AssignThemeToStore.php @@ -77,7 +77,7 @@ public function execute() } $response = ['message' => $successMessage, 'themeId' => $themeCustomization->getId()]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response = ['error' => true, 'message' => __('This theme is not assigned.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php index 39c68bb0a40a1..eca41fcefbff3 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Duplicate.php @@ -35,9 +35,9 @@ public function execute() $this->messageManager->addSuccess(__('You saved a duplicate copy of this theme in "My Customizations."')); } catch (CoreException $e) { $this->messageManager->addError($e->getMessage()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('You cannot duplicate this theme.')); } $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php index 101b7e111574d..a6623aded0a75 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Files/TreeJson.php @@ -23,7 +23,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode([]) ); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php index 5ff329a13f0f3..2de06eed51ea4 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Launch.php @@ -154,12 +154,12 @@ public function execute() $this->_view->renderLayout(); } catch (CoreException $e) { $this->messageManager->addException($e, $e->getMessage()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('adminhtml/*/'); return; } catch (\Exception $e) { $this->messageManager->addException($e, __('Sorry, there was an unknown error.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('adminhtml/*/'); return; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php index 2ccd95bbf3f0d..a33bd2d476d7e 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/LoadThemeList.php @@ -41,7 +41,7 @@ public function execute() $response = ['content' => $this->_view->getLayout()->getOutput()]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response = ['error' => __('Sorry, but we can\'t load the theme list.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php index d34e1bc1c58ab..191ba153fba26 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/QuickEdit.php @@ -31,9 +31,9 @@ public function execute() $response = ['success' => true]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response = ['error' => true, 'message' => __('This theme is not saved.')]; } $this->getResponse()->representJson($coreHelper->jsonEncode($response)); diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php index 1e39c8688dc07..7440420675a75 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Revert.php @@ -47,7 +47,7 @@ public function execute() } $response = ['message' => $message]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response = ['error' => true, 'message' => __('Unknown error')]; } /** @var $coreHelper \Magento\Core\Helper\Data */ diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php index 07893246c8a8e..6594a57ebe549 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Save.php @@ -28,7 +28,7 @@ public function execute() } $response = ['message' => $message]; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response = ['error' => true, 'message' => __('Sorry, there was an unknown error.')]; } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php index 2515d1ef020c1..fec2fb908a960 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/DeleteCustomFiles.php @@ -22,7 +22,7 @@ public function execute() $this->_forward('jsList'); } catch (\Exception $e) { $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php index 04954eb5fd9f6..b260d9e175d54 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/JsList.php @@ -24,7 +24,7 @@ public function execute() $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php index b63a6c1c064a2..12b8a161c678c 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveQuickStyleImage.php @@ -41,14 +41,14 @@ public function execute() $response = ['error' => false, 'content' => $result]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php index 4e53fd32abeae..1d2e9666f080c 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/RemoveStoreLogo.php @@ -50,14 +50,14 @@ public function execute() $response = ['error' => false, 'content' => []]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php index 474c114828629..f7fb123df0446 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/ReorderJs.php @@ -27,10 +27,10 @@ public function execute() $result = ['success' => true]; } catch (CoreException $e) { $result = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php index 0ee26290c8b93..8e2d1de1c79a2 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveCssContent.php @@ -35,10 +35,10 @@ public function execute() ]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We can\'t save the custom css file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php index bec9dde0bb052..d29d45cdedc6f 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveImageSizing.php @@ -35,10 +35,10 @@ public function execute() $result = ['success' => true, 'message' => __('We saved the image sizes.')]; } catch (CoreException $e) { $result = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We can\'t save image sizes.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php index a3444c0a3f120..53b8cbb302685 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/SaveQuickStyles.php @@ -31,14 +31,14 @@ public function execute() $response = ['success' => true]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php index 467d7738f7e4b..b6bce92f57015 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/Upload.php @@ -39,10 +39,10 @@ public function execute() ]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php index 4cb02a7149a09..53120e8379b44 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadJs.php @@ -33,10 +33,10 @@ public function execute() return; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $response = ['error' => true, 'message' => __('We cannot upload the JS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php index c1431963a5b8a..9ffd1d2e8cb3c 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadQuickStyleImage.php @@ -39,14 +39,14 @@ public function execute() } catch (CoreException $e) { $this->messageManager->addError($e->getMessage()); $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php index 5272738b3b14c..ee93ce4c57b1d 100644 --- a/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php +++ b/app/code/Magento/DesignEditor/Controller/Adminhtml/System/Design/Editor/Tools/UploadStoreLogo.php @@ -44,14 +44,14 @@ public function execute() $response = ['error' => false, 'content' => ['name' => basename($storeLogo->getValue())]]; } catch (CoreException $e) { $response = ['error' => true, 'message' => $e->getMessage()]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $errorMessage = __( 'Something went wrong uploading the image.' . ' Please check the file format and try again (JPEG, GIF, or PNG).' ); $response = ['error' => true, 'message' => $errorMessage]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($response) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 192050fe5fea0..b81ffca5c1081 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -184,7 +184,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -210,7 +210,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Directory/Model/PriceCurrency.php b/app/code/Magento/Directory/Model/PriceCurrency.php index dafb8e1faa682..3cc16e54ca6e2 100644 --- a/app/code/Magento/Directory/Model/PriceCurrency.php +++ b/app/code/Magento/Directory/Model/PriceCurrency.php @@ -6,7 +6,7 @@ use Magento\Framework\App\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Store\Model\Store; /** diff --git a/app/code/Magento/Directory/Model/Resource/Country/Collection.php b/app/code/Magento/Directory/Model/Resource/Country/Collection.php index dbf8bbd6c5917..ed505ab7aa0f4 100644 --- a/app/code/Magento/Directory/Model/Resource/Country/Collection.php +++ b/app/code/Magento/Directory/Model/Resource/Country/Collection.php @@ -43,7 +43,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Locale\ListsInterface $localeLists @@ -56,7 +56,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Locale\ListsInterface $localeLists, diff --git a/app/code/Magento/Directory/Model/Resource/Region/Collection.php b/app/code/Magento/Directory/Model/Resource/Region/Collection.php index 3669796392ec8..25e32fd40f550 100644 --- a/app/code/Magento/Directory/Model/Resource/Region/Collection.php +++ b/app/code/Magento/Directory/Model/Resource/Region/Collection.php @@ -31,7 +31,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Locale\ResolverInterface $localeResolver @@ -40,7 +40,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Locale\ResolverInterface $localeResolver, diff --git a/app/code/Magento/Downloadable/Model/Product/Type.php b/app/code/Magento/Downloadable/Model/Product/Type.php index 054db0e1eb825..3fa35f6189e4a 100644 --- a/app/code/Magento/Downloadable/Model/Product/Type.php +++ b/app/code/Magento/Downloadable/Model/Product/Type.php @@ -63,7 +63,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\Virtual * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param ProductRepositoryInterface $productRepository * @param \Magento\Downloadable\Helper\File $downloadableFile * @param \Magento\Downloadable\Model\Resource\SampleFactory $sampleResFactory @@ -82,7 +82,7 @@ public function __construct( \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository, \Magento\Downloadable\Helper\File $downloadableFile, \Magento\Downloadable\Model\Resource\SampleFactory $sampleResFactory, diff --git a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php index d27bd6c578140..f8a52ed7bde3d 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php @@ -75,18 +75,18 @@ abstract class AbstractData protected $_localeResolver; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver ) { $this->_localeDate = $localeDate; diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php index 0886e2d94abea..94b0e6ff1c674 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/File.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php @@ -38,7 +38,7 @@ class File extends \Magento\Eav\Model\Attribute\Data\AbstractData /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\Url\EncoderInterface $urlEncoder * @param \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator @@ -46,7 +46,7 @@ class File extends \Magento\Eav\Model\Attribute\Data\AbstractData */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\Url\EncoderInterface $urlEncoder, \Magento\Core\Model\File\Validator\NotProtectedExtension $fileValidator, diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Text.php b/app/code/Magento/Eav/Model/Attribute/Data/Text.php index 32e1485353669..e32506f45dd1f 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Text.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Text.php @@ -20,13 +20,13 @@ class Text extends \Magento\Eav\Model\Attribute\Data\AbstractData /** * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\Stdlib\String $stringHelper */ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\Stdlib\String $stringHelper ) { diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php index 4d4709d1ef6a9..9c10fc846bce2 100644 --- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php +++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php @@ -115,7 +115,7 @@ abstract class AbstractCollection extends \Magento\Framework\Data\Collection\Db /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -127,7 +127,7 @@ abstract class AbstractCollection extends \Magento\Framework\Data\Collection\Db */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Eav/Model/Entity/Setup/Context.php b/app/code/Magento/Eav/Model/Entity/Setup/Context.php index 2ce7e2f7411cb..b08b99d84ab25 100644 --- a/app/code/Magento/Eav/Model/Entity/Setup/Context.php +++ b/app/code/Magento/Eav/Model/Entity/Setup/Context.php @@ -14,7 +14,7 @@ class Context extends \Magento\Framework\Module\Setup\Context protected $attributeMapper; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\App\Resource $appResource * @param \Magento\Framework\Module\Dir\Reader $modulesReader @@ -26,7 +26,7 @@ class Context extends \Magento\Framework\Module\Setup\Context * @param PropertyMapperInterface $attributeMapper */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\App\Resource $appResource, \Magento\Framework\Module\Dir\Reader $modulesReader, diff --git a/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php b/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php index 0a9317b4f9f08..6cb28f94a1cc2 100644 --- a/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php @@ -39,7 +39,7 @@ abstract class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\C /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -49,7 +49,7 @@ abstract class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\C */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Collection.php index 8a98da583ab4d..240a6419a3230 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Collection.php @@ -27,7 +27,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -36,7 +36,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php index a6ac2254c5e23..5aa44c5e8235e 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php @@ -20,7 +20,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collec /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Registry $registryManager @@ -29,7 +29,7 @@ class Collection extends \Magento\Eav\Model\Resource\Entity\Attribute\Set\Collec */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Registry $registryManager, diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index 103f98ab77078..63f6ace2580ef 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -30,7 +30,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\App\Resource $coreResource @@ -40,7 +40,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\App\Resource $coreResource, diff --git a/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php b/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php index 780c1e81c7b2b..269fd414eccfe 100644 --- a/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php @@ -51,7 +51,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -61,7 +61,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php b/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php index 5cd3436044bbe..33a959f9b95c8 100644 --- a/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php @@ -16,7 +16,7 @@ use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Model\Resource\Db\AbstractDb; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Store\Model\StoreManagerInterface; class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php index 95e2cc37a652d..8ffde1bd2a164 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/DefaultTemplate.php @@ -29,7 +29,7 @@ public function execute() $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($template->getData()) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php index 390449040fa5c..1e2c4d369644a 100644 --- a/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php +++ b/app/code/Magento/Email/Controller/Adminhtml/Email/Template/Delete.php @@ -38,7 +38,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting email template data. Please review log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); // save data in session $this->_objectManager->get( 'Magento\Backend\Model\Session' diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 23042755a4265..5bdfa48d88448 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -51,7 +51,7 @@ class Filter extends \Magento\Framework\Filter\Template protected $_assetRepo; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -111,7 +111,7 @@ class Filter extends \Magento\Framework\Filter\Template /** * @param \Magento\Framework\Stdlib\String $string - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -127,7 +127,7 @@ class Filter extends \Magento\Framework\Filter\Template */ public function __construct( \Magento\Framework\Stdlib\String $string, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 74c42bf547678..7b94207a152a7 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -107,7 +107,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C protected $_storeManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -119,7 +119,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -141,7 +141,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php index 0db9bc133cbbc..233891f88b26f 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php @@ -41,7 +41,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('Something went wrong during Captcha confirmation.')); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php index 7af24ce927830..d9b5666035478 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAdd.php @@ -48,7 +48,7 @@ public function execute() __('An error has occurred while adding products to google shopping account.'), $e->getMessage() ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); return; } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php index 86fefea98a0c1..8d9a12f1ee37c 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Refresh.php @@ -55,7 +55,7 @@ public function execute() 'One or more products were not deleted from google shopping account. Refer to the log file for details.' ) ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); return; } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php index 2edcfdf8e124a..57fc8b200a6f1 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Delete.php @@ -23,7 +23,7 @@ public function execute() } $this->messageManager->addSuccess(__('Attribute set mapping was deleted')); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__("We can't delete Attribute Set Mapping.")); } $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php index becfb35dcaf4c..1817702a5c7e0 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Edit.php @@ -43,7 +43,7 @@ public function execute() $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Google Content Attributes')); $this->_view->renderLayout(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__("We can't edit Attribute Set Mapping.")); $this->_redirect('adminhtml/*/index'); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php index c76f979a21ccd..3daee5428e1cb 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributeSets.php @@ -23,7 +23,7 @@ public function execute() )->toHtml() ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); // just need to output text with error $this->messageManager->addError(__("We can't load attribute sets.")); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php index 460df0e645146..e427a4664df17 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/LoadAttributes.php @@ -27,7 +27,7 @@ public function execute() )->toHtml() ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); // just need to output text with error $this->messageManager->addError(__("We can't load attributes.")); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php index db5181519edb3..2d56b33d6674e 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/NewAction.php @@ -26,7 +26,7 @@ public function execute() $this->_view->getPage()->getConfig()->getTitle()->prepend(__('New Google Content Attribute Mapping')); $this->_view->renderLayout(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__("We can't create Attribute Set Mapping.")); $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); } diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php index b57f533e8ee11..f2ee9b58d4bd8 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types/Save.php @@ -71,7 +71,7 @@ public function execute() ); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__("We can't save Attribute Set Mapping.")); } $this->_redirect('adminhtml/*/index', ['store' => $this->_getStore()->getId()]); diff --git a/app/code/Magento/GoogleShopping/Model/MassOperations.php b/app/code/Magento/GoogleShopping/Model/MassOperations.php index 3e1b53b22fcb6..52c6f69d1e9d1 100644 --- a/app/code/Magento/GoogleShopping/Model/MassOperations.php +++ b/app/code/Magento/GoogleShopping/Model/MassOperations.php @@ -69,7 +69,7 @@ class MassOperations * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository * @param \Magento\Framework\Notification\NotifierInterface $notifier * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\GoogleShopping\Helper\Data $gleShoppingData * @param \Magento\GoogleShopping\Helper\Category $gleShoppingCategory * @param array $data @@ -80,7 +80,7 @@ public function __construct( \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Framework\Notification\NotifierInterface $notifier, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\GoogleShopping\Helper\Data $gleShoppingData, \Magento\GoogleShopping\Helper\Category $gleShoppingCategory, array $data = [] @@ -119,7 +119,7 @@ public function __construct( /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php b/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php index 345e68b911d80..4b932e02a34b5 100644 --- a/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php +++ b/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php @@ -27,7 +27,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\DB\Helper $resourceHelper @@ -37,7 +37,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\DB\Helper $resourceHelper, diff --git a/app/code/Magento/GoogleShopping/Model/Service.php b/app/code/Magento/GoogleShopping/Model/Service.php index 511b5d5998316..e421d731a0647 100644 --- a/app/code/Magento/GoogleShopping/Model/Service.php +++ b/app/code/Magento/GoogleShopping/Model/Service.php @@ -35,7 +35,7 @@ class Service extends \Magento\Framework\Object /** * Log adapter factory * - * @var \Magento\Framework\Logger\AdapterFactory + * @var \Psr\Log\LoggerInterface\AdapterFactory */ protected $_logAdapterFactory; @@ -57,14 +57,14 @@ class Service extends \Magento\Framework\Object * By default is looking for first argument as array and assigns it as object * attributes This behavior may change in child classes * - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory * @param array $data */ public function __construct( - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Framework\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory, diff --git a/app/code/Magento/GoogleShopping/Model/Service/Item.php b/app/code/Magento/GoogleShopping/Model/Service/Item.php index d00483fe86c40..3ee511cb4f371 100644 --- a/app/code/Magento/GoogleShopping/Model/Service/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Service/Item.php @@ -24,7 +24,7 @@ class Item extends \Magento\GoogleShopping\Model\Service protected $_date; /** - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory @@ -33,7 +33,7 @@ class Item extends \Magento\GoogleShopping\Model\Service * @param array $data */ public function __construct( - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Framework\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory, diff --git a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php index 96e19a61b0c3f..350cc7bb44148 100644 --- a/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php +++ b/app/code/Magento/GroupedProduct/Controller/Adminhtml/Edit/Popup.php @@ -18,7 +18,7 @@ class Popup extends \Magento\Backend\App\AbstractAction protected $factory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -26,13 +26,13 @@ class Popup extends \Magento\Backend\App\AbstractAction * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $factory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\ProductFactory $factory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->registry = $registry; $this->factory = $factory; diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 34a82a60b5c13..4a6f83b3ffd02 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -88,7 +88,7 @@ class Grouped extends \Magento\Catalog\Model\Product\Type\AbstractType * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDb * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param ProductRepositoryInterface $productRepository * @param \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -107,7 +107,7 @@ public function __construct( \Magento\Core\Helper\File\Storage\Database $fileStorageDb, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, ProductRepositoryInterface $productRepository, \Magento\GroupedProduct\Model\Resource\Product\Link $catalogProductLink, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php index 923420bb700d0..c66cd3d23f38b 100644 --- a/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/GroupedProduct/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php @@ -27,7 +27,7 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\Resource\Produ /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -53,7 +53,7 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\Resource\Produ */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php index cf4d1863bc063..1ed8b3eb9e2fb 100644 --- a/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php +++ b/app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php @@ -48,7 +48,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('Please correct the data sent.')); } } else { diff --git a/app/code/Magento/ImportExport/Model/AbstractModel.php b/app/code/Magento/ImportExport/Model/AbstractModel.php index 9aa76d99cab6c..987884e46fabc 100644 --- a/app/code/Magento/ImportExport/Model/AbstractModel.php +++ b/app/code/Magento/ImportExport/Model/AbstractModel.php @@ -35,7 +35,7 @@ abstract class AbstractModel extends \Magento\Framework\Object protected $_logTrace = []; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -45,12 +45,12 @@ abstract class AbstractModel extends \Magento\Framework\Object protected $_varDirectory; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param array $data */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, array $data = [] ) { diff --git a/app/code/Magento/ImportExport/Model/Export.php b/app/code/Magento/ImportExport/Model/Export.php index 29f23a022eafc..d4555391afd3d 100644 --- a/app/code/Magento/ImportExport/Model/Export.php +++ b/app/code/Magento/ImportExport/Model/Export.php @@ -56,7 +56,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel protected $_exportAdapterFac; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig * @param \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory @@ -64,7 +64,7 @@ class Export extends \Magento\ImportExport\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig, \Magento\ImportExport\Model\Export\Entity\Factory $entityFactory, diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 88b8226e49887..37f63e1ce2978 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -110,7 +110,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel protected $_filesystem; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\ImportExport\Helper\Data $importExportData * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig @@ -125,7 +125,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\ImportExport\Helper\Data $importExportData, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index 8e8b39726f7aa..2e1acd132001d 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -27,7 +27,7 @@ class Integration extends Action */ protected $_registry; - /** @var \Magento\Framework\Logger */ + /** @var \Psr\Log\LoggerInterface */ protected $_logger; /** @var \Magento\Integration\Service\V1\IntegrationInterface */ @@ -53,7 +53,7 @@ class Integration extends Action /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Integration\Service\V1\IntegrationInterface $integrationService * @param IntegrationOauthService $oauthService * @param \Magento\Core\Helper\Data $coreHelper @@ -64,7 +64,7 @@ class Integration extends Action public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Integration\Service\V1\IntegrationInterface $integrationService, IntegrationOauthService $oauthService, \Magento\Core\Helper\Data $coreHelper, diff --git a/app/code/Magento/Integration/Service/V1/AuthorizationService.php b/app/code/Magento/Integration/Service/V1/AuthorizationService.php index e394eba6f0793..b6aed4022ff57 100644 --- a/app/code/Magento/Integration/Service/V1/AuthorizationService.php +++ b/app/code/Magento/Integration/Service/V1/AuthorizationService.php @@ -15,7 +15,7 @@ use Magento\Framework\Acl\Builder as AclBuilder; use Magento\Framework\Acl\RootResource as RootAclResource; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Service for integration permissions management. diff --git a/app/code/Magento/Integration/Service/V1/Oauth.php b/app/code/Magento/Integration/Service/V1/Oauth.php index 58144ab6b2e51..85f72fca0d09b 100644 --- a/app/code/Magento/Integration/Service/V1/Oauth.php +++ b/app/code/Magento/Integration/Service/V1/Oauth.php @@ -46,7 +46,7 @@ class Oauth implements OauthInterface protected $_httpClient; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -68,7 +68,7 @@ class Oauth implements OauthInterface * @param TokenFactory $tokenFactory * @param IntegrationOauthHelper $dataHelper * @param \Magento\Framework\HTTP\ZendClient $httpClient - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param OauthHelper $oauthHelper * @param TokenProvider $tokenProvider */ @@ -78,7 +78,7 @@ public function __construct( TokenFactory $tokenFactory, IntegrationOauthHelper $dataHelper, \Magento\Framework\HTTP\ZendClient $httpClient, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, OauthHelper $oauthHelper, TokenProvider $tokenProvider ) { diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php b/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php index cfdaae9d44bfc..f0188880781d8 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php @@ -25,7 +25,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Helper\Data $eavHelper @@ -34,7 +34,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Helper\Data $eavHelper, diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php b/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php index 32971b43e8dfc..43ad11917851c 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php @@ -15,7 +15,7 @@ class Collection extends \Magento\Log\Model\Resource\Visitor\Online\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Helper\Data $eavHelper @@ -25,7 +25,7 @@ class Collection extends \Magento\Log\Model\Resource\Visitor\Online\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Helper\Data $eavHelper, diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Overview.php b/app/code/Magento/Multishipping/Controller/Checkout/Overview.php index 54d8285274875..23474bac028c9 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Overview.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Overview.php @@ -41,7 +41,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addException($e, __('We cannot open the overview page.')); $this->_redirect('*/*/billing'); } diff --git a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php index 01b4a42a2a957..22b3cad9e9a88 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/OverviewPost.php @@ -105,7 +105,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_redirect('*/*/billing'); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_objectManager->get( 'Magento\Checkout\Helper\Data' )->sendPaymentFailedEmail( diff --git a/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php index 2725043fc129a..57fbf47df9136 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php @@ -56,7 +56,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param CustomerRepository $customerRepository @@ -66,7 +66,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, CustomerRepository $customerRepository, diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php index c967aa6e7ba39..99ad006db65e1 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php @@ -34,7 +34,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date @@ -43,7 +43,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php index 6b405f08c3862..1da9cb8fd70a0 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php @@ -57,7 +57,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Helper\Data $customerHelperData @@ -66,7 +66,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Helper\Data $customerHelperData, diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php index b7cb5714f6442..559102029f395 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php @@ -35,7 +35,7 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -43,7 +43,7 @@ class Flatrate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implement public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 3726bb282e36b..5fac8565babe6 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -36,7 +36,7 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -44,7 +44,7 @@ class Freeshipping extends \Magento\Shipping\Model\Carrier\AbstractCarrier imple public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php index 133816020ee4a..d689bef7b9567 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php @@ -30,7 +30,7 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory * @param array $data @@ -38,7 +38,7 @@ class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, array $data = [] diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php index aa61363567b0d..710c6b45ff3d3 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Tablerate.php @@ -45,7 +45,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory * @param \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory @@ -54,7 +54,7 @@ class Tablerate extends \Magento\Shipping\Model\Carrier\AbstractCarrier implemen public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory, \Magento\OfflineShipping\Model\Resource\Carrier\TablerateFactory $tablerateFactory, diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 3f16e68e1a8a6..ee3d001166fe3 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -85,7 +85,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_coreConfig; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -118,7 +118,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\OfflineShipping\Model\Carrier\Tablerate $carrierTablerate @@ -128,7 +128,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\OfflineShipping\Model\Carrier\Tablerate $carrierTablerate, diff --git a/app/code/Magento/Ogone/Model/Api.php b/app/code/Magento/Ogone/Model/Api.php index 49ef1de05d9f8..4943812f89456 100644 --- a/app/code/Magento/Ogone/Model/Api.php +++ b/app/code/Magento/Ogone/Model/Api.php @@ -456,7 +456,7 @@ class Api extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\UrlInterface $urlBuilder @@ -468,7 +468,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\UrlInterface $urlBuilder, diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index 993666627b4ea..c50920b5d3d54 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -199,7 +199,7 @@ abstract class AbstractMethod extends \Magento\Framework\Object implements Metho /** * Log adapter factory * - * @var \Magento\Framework\Logger\AdapterFactory + * @var \Psr\Log\LoggerInterface\AdapterFactory */ protected $_logAdapterFactory; @@ -209,14 +209,14 @@ abstract class AbstractMethod extends \Magento\Framework\Object implements Metho * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, array $data = [] ) { parent::__construct($data); diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index 457911b28ea2d..8cb5cbc0089b9 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -41,7 +41,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod /** * Construct * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -49,8 +49,8 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -60,8 +60,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index e5bf9c1ba6e1d..3a3bde6cd3230 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -43,7 +43,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param PriceCurrencyInterface $priceCurrency * @param array $data */ @@ -51,7 +51,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, PriceCurrencyInterface $priceCurrency, array $data = [] ) { diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php index 297802cab4907..95a5c9f4d08ce 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Cancel.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We could not cancel the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('paypal/*/view', ['_current' => true]); } diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php index 83abbe75ad580..78a8e6b40ae4d 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Billing/Agreement/Delete.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We could not delete the billing agreement.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('paypal/*/view', ['_current' => true]); } diff --git a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php index e764c773c4a69..3c7cf5a5b1cb7 100644 --- a/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php +++ b/app/code/Magento/Paypal/Controller/Adminhtml/Paypal/Reports.php @@ -27,7 +27,7 @@ class Reports extends \Magento\Backend\App\Action protected $_settlementFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -36,14 +36,14 @@ class Reports extends \Magento\Backend\App\Action * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Paypal\Model\Report\Settlement\RowFactory $rowFactory * @param \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Paypal\Model\Report\Settlement\RowFactory $rowFactory, \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_coreRegistry = $coreRegistry; $this->_rowFactory = $rowFactory; diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php index f2e4f00763c95..c21a26403ec19 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/Cancel.php @@ -28,7 +28,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('We couldn\'t cancel the billing agreement.')); } } diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php index 6b760dfe90738..e4bc1047856cf 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/ReturnWizard.php @@ -38,7 +38,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('We couldn\'t finish the billing agreement wizard.')); } $this->_redirect('*/*/index'); diff --git a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php b/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php index 8a688ea974a5a..cea550f957d3d 100644 --- a/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php +++ b/app/code/Magento/Paypal/Controller/Billing/Agreement/StartWizard.php @@ -35,7 +35,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('We couldn\'t start the billing agreement wizard.')); } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php index 2192302b16ea3..b1df8c4a4ea38 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Cancel.php @@ -36,7 +36,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('Unable to cancel Express Checkout')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('checkout/cart'); diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php index 6d71fbe17d46e..706b037c43cd2 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php @@ -66,7 +66,7 @@ public function execute() $this->_redirect('*/*/review'); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t place the order.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('*/*/review'); } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php index 0c990b85affbb..da952231c7ec6 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php @@ -34,7 +34,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t process Express Checkout approval.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('checkout/cart'); } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php index a86e0f6dd0eb5..043ccc2dfc5e6 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Review.php @@ -33,7 +33,7 @@ public function execute() $this->messageManager->addError( __('We can\'t initialize Express Checkout review.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('checkout/cart'); } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php index d359572a27f1a..3819bab5e065e 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/SaveShippingMethod.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } if ($isAjax) { $this->getResponse()->setBody( diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php index a902eb800b29d..827339d56fbfc 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ShippingOptionsCallback.php @@ -61,7 +61,7 @@ public function execute() $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams()); $this->getResponse()->setBody($response); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php index c7330479e086f..3daf6b43b7a2b 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/Start.php @@ -81,7 +81,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t start Express Checkout.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('checkout/cart'); diff --git a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php index 9f2b22b1f4d20..979100f869fca 100644 --- a/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php +++ b/app/code/Magento/Paypal/Controller/Express/AbstractExpress/UpdateShippingMethods.php @@ -31,7 +31,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update shipping method.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->setBody( '' diff --git a/app/code/Magento/Paypal/Controller/Ipn/Index.php b/app/code/Magento/Paypal/Controller/Ipn/Index.php index e85785023502a..06713f42052c6 100644 --- a/app/code/Magento/Paypal/Controller/Ipn/Index.php +++ b/app/code/Magento/Paypal/Controller/Ipn/Index.php @@ -14,7 +14,7 @@ class Index extends \Magento\Framework\App\Action\Action { /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -26,12 +26,12 @@ class Index extends \Magento\Framework\App\Action\Action /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Paypal\Model\IpnFactory $ipnFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Paypal\Model\IpnFactory $ipnFactory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_logger = $logger; $this->_ipnFactory = $ipnFactory; diff --git a/app/code/Magento/Paypal/Controller/Payflow.php b/app/code/Magento/Paypal/Controller/Payflow.php index b63f9b0acda62..c46f9ce124f7e 100644 --- a/app/code/Magento/Paypal/Controller/Payflow.php +++ b/app/code/Magento/Paypal/Controller/Payflow.php @@ -20,7 +20,7 @@ class Payflow extends \Magento\Framework\App\Action\Action protected $_orderFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -46,7 +46,7 @@ class Payflow extends \Magento\Framework\App\Action\Action * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Paypal\Model\PayflowlinkFactory $payflowModelFactory * @param \Magento\Paypal\Helper\Checkout $checkoutHelper - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -54,7 +54,7 @@ public function __construct( \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Paypal\Model\PayflowlinkFactory $payflowModelFactory, \Magento\Paypal\Helper\Checkout $checkoutHelper, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_checkoutSession = $checkoutSession; $this->_orderFactory = $orderFactory; diff --git a/app/code/Magento/Paypal/Model/AbstractIpn.php b/app/code/Magento/Paypal/Model/AbstractIpn.php index 72ce4efddd70a..583227b62bc44 100644 --- a/app/code/Magento/Paypal/Model/AbstractIpn.php +++ b/app/code/Magento/Paypal/Model/AbstractIpn.php @@ -45,13 +45,13 @@ class AbstractIpn /** * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory * @param array $data */ public function __construct( \Magento\Paypal\Model\ConfigFactory $configFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, array $data = [] ) { diff --git a/app/code/Magento/Paypal/Model/Api/AbstractApi.php b/app/code/Magento/Paypal/Model/Api/AbstractApi.php index 7266783031f26..aa974746bb715 100644 --- a/app/code/Magento/Paypal/Model/Api/AbstractApi.php +++ b/app/code/Magento/Paypal/Model/Api/AbstractApi.php @@ -82,7 +82,7 @@ abstract class AbstractApi extends \Magento\Framework\Object protected $_customerAddress; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -97,7 +97,7 @@ abstract class AbstractApi extends \Magento\Framework\Object protected $_regionFactory; /** - * @var \Magento\Framework\Logger\AdapterFactory + * @var \Psr\Log\LoggerInterface\AdapterFactory */ protected $_logAdapterFactory; @@ -108,18 +108,18 @@ abstract class AbstractApi extends \Magento\Framework\Object * attributes This behavior may change in child classes * * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( \Magento\Customer\Helper\Address $customerAddress, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, array $data = [] ) { $this->_customerAddress = $customerAddress; diff --git a/app/code/Magento/Paypal/Model/Api/Nvp.php b/app/code/Magento/Paypal/Model/Api/Nvp.php index 05517f84e7a10..82dd7ada7c27e 100644 --- a/app/code/Magento/Paypal/Model/Api/Nvp.php +++ b/app/code/Magento/Paypal/Model/Api/Nvp.php @@ -741,10 +741,10 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi /** * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory @@ -753,10 +753,10 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi */ public function __construct( \Magento\Customer\Helper\Address $customerAddress, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, diff --git a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php index 11145aeafbf7c..483a3bb3980ab 100644 --- a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php +++ b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php @@ -439,10 +439,10 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp /** * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory @@ -453,10 +453,10 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp */ public function __construct( \Magento\Customer\Helper\Address $customerAddress, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php index 499839cea42f0..e994559453220 100644 --- a/app/code/Magento/Paypal/Model/Direct.php +++ b/app/code/Magento/Paypal/Model/Direct.php @@ -134,8 +134,8 @@ class Direct extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -152,8 +152,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Paypal/Model/Express.php b/app/code/Magento/Paypal/Model/Express.php index 4fab1d56be396..17c0e989059aa 100644 --- a/app/code/Magento/Paypal/Model/Express.php +++ b/app/code/Magento/Paypal/Model/Express.php @@ -165,7 +165,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param ProFactory $proFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $urlBuilder @@ -178,7 +178,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, ProFactory $proFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlBuilder, diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 06492302db8af..3e149d8b1e425 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -169,7 +169,7 @@ class Checkout protected $_customerUrl; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -199,7 +199,7 @@ class Checkout protected $_cartFactory; /** - * @var \Magento\Framework\Logger\AdapterFactory + * @var \Psr\Log\LoggerInterface\AdapterFactory */ protected $_logFactory; @@ -271,7 +271,7 @@ class Checkout /** * Set config, session and quote instances * - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Customer\Model\Url $customerUrl * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Checkout\Helper\Data $checkoutData @@ -282,7 +282,7 @@ class Checkout * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $coreUrl * @param \Magento\Paypal\Model\CartFactory $cartFactory - * @param \Magento\Framework\Logger\AdapterFactory $logFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logFactory * @param \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory * @param \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory @@ -300,7 +300,7 @@ class Checkout * @throws \Exception */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Customer\Model\Url $customerUrl, \Magento\Tax\Helper\Data $taxData, \Magento\Checkout\Helper\Data $checkoutData, @@ -311,7 +311,7 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $coreUrl, \Magento\Paypal\Model\CartFactory $cartFactory, - \Magento\Framework\Logger\AdapterFactory $logFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logFactory, \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory, \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, diff --git a/app/code/Magento/Paypal/Model/Hostedpro.php b/app/code/Magento/Paypal/Model/Hostedpro.php index 5363c71d8b183..1817268f56229 100644 --- a/app/code/Magento/Paypal/Model/Hostedpro.php +++ b/app/code/Magento/Paypal/Model/Hostedpro.php @@ -71,8 +71,8 @@ class Hostedpro extends \Magento\Paypal\Model\Direct * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -90,8 +90,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Paypal/Model/Ipn.php b/app/code/Magento/Paypal/Model/Ipn.php index cf93bcb51fae5..177a575d0fdca 100644 --- a/app/code/Magento/Paypal/Model/Ipn.php +++ b/app/code/Magento/Paypal/Model/Ipn.php @@ -42,7 +42,7 @@ class Ipn extends \Magento\Paypal\Model\AbstractIpn implements IpnInterface /** * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param Info $paypalInfo @@ -52,7 +52,7 @@ class Ipn extends \Magento\Paypal\Model\AbstractIpn implements IpnInterface */ public function __construct( \Magento\Paypal\Model\ConfigFactory $configFactory, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, \Magento\Sales\Model\OrderFactory $orderFactory, Info $paypalInfo, diff --git a/app/code/Magento/Paypal/Model/Method/Agreement.php b/app/code/Magento/Paypal/Model/Method/Agreement.php index 824506b4c1b9e..936b2604146f3 100644 --- a/app/code/Magento/Paypal/Model/Method/Agreement.php +++ b/app/code/Magento/Paypal/Model/Method/Agreement.php @@ -117,7 +117,7 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Paypal\Model\ProFactory $proFactory @@ -131,7 +131,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Paypal\Model\ProFactory $proFactory, diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index e68422948a5d7..d2c40e4f47a1a 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -33,7 +33,7 @@ class Observer protected $_coreData; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -66,7 +66,7 @@ class Observer * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Paypal\Helper\Hss $paypalHss * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param Report\SettlementFactory $settlementFactory * @param \Magento\Framework\App\ViewInterface $view * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory @@ -77,7 +77,7 @@ public function __construct( \Magento\Core\Helper\Data $coreData, \Magento\Paypal\Helper\Hss $paypalHss, \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory, \Magento\Framework\App\ViewInterface $view, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, diff --git a/app/code/Magento/Paypal/Model/PayflowExpress.php b/app/code/Magento/Paypal/Model/PayflowExpress.php index e880fe8edbbaa..f454a30afc893 100644 --- a/app/code/Magento/Paypal/Model/PayflowExpress.php +++ b/app/code/Magento/Paypal/Model/PayflowExpress.php @@ -35,7 +35,7 @@ class PayflowExpress extends \Magento\Paypal\Model\Express * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param ProFactory $proFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $urlBuilder @@ -49,7 +49,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, ProFactory $proFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlBuilder, diff --git a/app/code/Magento/Paypal/Model/Payflowlink.php b/app/code/Magento/Paypal/Model/Payflowlink.php index c7a2b082a0118..6be0ac4979527 100644 --- a/app/code/Magento/Paypal/Model/Payflowlink.php +++ b/app/code/Magento/Paypal/Model/Payflowlink.php @@ -136,8 +136,8 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -159,8 +159,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php index 8709324a2cd27..0d3afe955d1a3 100644 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ b/app/code/Magento/Paypal/Model/Payflowpro.php @@ -216,8 +216,8 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Centinel\Model\Service $centinelService @@ -233,8 +233,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, diff --git a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php index 6c549f7ea3727..008234ace9372 100644 --- a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php +++ b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php @@ -42,7 +42,7 @@ abstract class AbstractAgreement extends \Magento\Payment\Model\Method\AbstractM * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param array $data */ @@ -50,7 +50,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, array $data = [] ) { diff --git a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php index d3d2fc6ed5834..ca5ff96879a0c 100644 --- a/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php +++ b/app/code/Magento/Paypal/Model/Resource/Billing/Agreement/Collection.php @@ -38,7 +38,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer $customerResource @@ -48,7 +48,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer $customerResource, diff --git a/app/code/Magento/Paypal/Model/Standard.php b/app/code/Magento/Paypal/Model/Standard.php index 2c9141143796d..933fa6cd35be8 100644 --- a/app/code/Magento/Paypal/Model/Standard.php +++ b/app/code/Magento/Paypal/Model/Standard.php @@ -85,7 +85,7 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Logger\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Framework\Session\Generic $paypalSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Framework\UrlInterface $urlBuilder @@ -102,7 +102,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Logger\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Framework\Session\Generic $paypalSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\UrlInterface $urlBuilder, diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php index 1f880f78c7816..18e7b255e4238 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Product/Viewed.php @@ -49,7 +49,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while showing the product views report. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('reports/*/viewed/'); return; } diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php index fb2c8545ecc81..956d727041cb8 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshLifetime.php @@ -25,7 +25,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t refresh lifetime statistics.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } if ($this->_getSession()->isFirstPageAfterLogin()) { diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php index 967006fb2fb7f..dd6cf080fa756 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics/RefreshRecent.php @@ -28,7 +28,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t refresh recent statistics.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } if ($this->_getSession()->isFirstPageAfterLogin()) { diff --git a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php index bf5a1d3c700a0..12bf75598b5ce 100644 --- a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php @@ -67,7 +67,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -85,7 +85,7 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Reports/Model/Resource/Order/Collection.php b/app/code/Magento/Reports/Model/Resource/Order/Collection.php index d5fbb0d48a288..5e90b28e091f9 100644 --- a/app/code/Magento/Reports/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Order/Collection.php @@ -56,7 +56,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\DB\Helper $coreResourceHelper @@ -72,7 +72,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\DB\Helper $coreResourceHelper, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Collection.php index 04c689b3eb98a..28ad32d28ed42 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Collection.php @@ -54,7 +54,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -81,7 +81,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php index 5e3234b226212..6a980688534b0 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php @@ -26,7 +26,7 @@ abstract class AbstractCollection extends \Magento\Catalog\Model\Resource\Produc /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -51,7 +51,7 @@ abstract class AbstractCollection extends \Magento\Catalog\Model\Resource\Produc */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php index 6e6251cad6c8b..c6e28286319ba 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -43,7 +43,7 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -73,7 +73,7 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Reports/Model/Resource/Quote/Collection.php b/app/code/Magento/Reports/Model/Resource/Quote/Collection.php index 89c1a3ea0d6d0..50a0031ab5f11 100644 --- a/app/code/Magento/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Quote/Collection.php @@ -45,7 +45,7 @@ class Collection extends \Magento\Sales\Model\Resource\Quote\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Product\Collection $productResource @@ -55,7 +55,7 @@ class Collection extends \Magento\Sales\Model\Resource\Quote\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Product\Collection $productResource, diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 1f9723f110769..8fea5b72d7d08 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -18,7 +18,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr protected $_flag = null; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -34,7 +34,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -42,7 +42,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index 8224d7952e754..0065c5b791cdf 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -39,7 +39,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -49,7 +49,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php index b23f2bbafb1cb..7923155007ee7 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -26,7 +26,7 @@ class Collection extends \Magento\Reports\Model\Resource\Report\Collection\Abstr /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -34,7 +34,7 @@ class Collection extends \Magento\Reports\Model\Resource\Report\Collection\Abstr */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php index 4d9785f546263..6c3e9d99b3e7e 100644 --- a/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php @@ -19,7 +19,7 @@ class Collection extends \Magento\Review\Model\Resource\Review\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Review\Helper\Data $reviewData @@ -31,7 +31,7 @@ class Collection extends \Magento\Review\Model\Resource\Review\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Review\Helper\Data $reviewData, diff --git a/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php b/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php index f06e1bcabab3c..c692dc1c0acb6 100644 --- a/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php @@ -26,7 +26,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerResFactory @@ -35,7 +35,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerResFactory, diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index 333d558e746bb..1bbc2610ff55c 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -47,7 +47,7 @@ class Product extends \Magento\Framework\App\Action\Action /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -98,7 +98,7 @@ class Product extends \Magento\Framework\App\Action\Action * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param \Magento\Review\Model\RatingFactory $ratingFactory @@ -112,7 +112,7 @@ public function __construct( \Magento\Framework\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Review\Model\ReviewFactory $reviewFactory, \Magento\Review\Model\RatingFactory $ratingFactory, diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index 535e963d9723d..64ba57293a043 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -26,13 +26,13 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $moduleManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Review\Helper\Data $ratingData * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -40,7 +40,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\Manager $moduleManager, \Magento\Review\Helper\Data $ratingData, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Review/Model/Resource/Rating/Collection.php b/app/code/Magento/Review/Model/Resource/Rating/Collection.php index 59a4578e2931d..290814cf08be1 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Collection.php @@ -29,7 +29,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -39,7 +39,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Review/Model/Resource/Rating/Grid/Collection.php b/app/code/Magento/Review/Model/Resource/Rating/Grid/Collection.php index 69875d13f8592..57c530f0a0c10 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Grid/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Grid/Collection.php @@ -20,7 +20,7 @@ class Collection extends \Magento\Review\Model\Resource\Rating\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -31,7 +31,7 @@ class Collection extends \Magento\Review\Model\Resource\Rating\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/Magento/Review/Model/Resource/Rating/Option/Vote/Collection.php index 02a3d934520ff..c106f65892a24 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option/Vote/Collection.php @@ -25,7 +25,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -35,7 +35,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Review/Model/Resource/Review/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Collection.php index 2e2694c0f8614..7c0e4fb196a42 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Collection.php @@ -75,7 +75,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Review\Helper\Data $reviewData @@ -86,7 +86,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Review\Helper\Data $reviewData, diff --git a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php index ea67d81c0569b..e43f85a0fcfe5 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php @@ -57,7 +57,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig @@ -83,7 +83,7 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, diff --git a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php index b4b00c2d25267..db45d49c4ce6e 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php @@ -20,13 +20,13 @@ class Collection extends \Magento\Framework\Data\Collection\Db /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\App\Resource $resource */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\App\Resource $resource ) { diff --git a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php index a217415827c0a..4f7e300d2e63b 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php @@ -22,7 +22,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic protected $httpAuthentication; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -45,7 +45,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param \Magento\Framework\HTTP\Authentication $httpAuthentication - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\AuthorizationInterface $authorization */ public function __construct( @@ -55,7 +55,7 @@ public function __construct( \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\HTTP\Authentication $httpAuthentication, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\AuthorizationInterface $authorization ) { $this->httpAuthentication = $httpAuthentication; diff --git a/app/code/Magento/Rss/Controller/Feed.php b/app/code/Magento/Rss/Controller/Feed.php index 84fd2cd0fd99c..06a19e3c9dad0 100644 --- a/app/code/Magento/Rss/Controller/Feed.php +++ b/app/code/Magento/Rss/Controller/Feed.php @@ -25,7 +25,7 @@ class Feed extends \Magento\Framework\App\Action\Action protected $httpAuthentication; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -52,7 +52,7 @@ class Feed extends \Magento\Framework\App\Action\Action * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Api\AccountManagementInterface $customerAccountManagement * @param \Magento\Framework\HTTP\Authentication $httpAuthentication - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -62,7 +62,7 @@ public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Api\AccountManagementInterface $customerAccountManagement, \Magento\Framework\HTTP\Authentication $httpAuthentication, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->rssManager = $rssManager; $this->scopeConfig = $scopeConfig; diff --git a/app/code/Magento/Rule/Model/Condition/Combine.php b/app/code/Magento/Rule/Model/Condition/Combine.php index ec15afef65d71..75362ace2c730 100644 --- a/app/code/Magento/Rule/Model/Condition/Combine.php +++ b/app/code/Magento/Rule/Model/Condition/Combine.php @@ -12,7 +12,7 @@ class Combine extends AbstractCondition protected $_conditionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/app/code/Magento/Rule/Model/Condition/Context.php b/app/code/Magento/Rule/Model/Condition/Context.php index 5c7a32fb71296..58ef010e23078 100644 --- a/app/code/Magento/Rule/Model/Condition/Context.php +++ b/app/code/Magento/Rule/Model/Condition/Context.php @@ -32,7 +32,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface protected $_conditionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -41,14 +41,14 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Framework\View\LayoutInterface $layout * @param \Magento\Rule\Model\ConditionFactory $conditionFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\View\LayoutInterface $layout, \Magento\Rule\Model\ConditionFactory $conditionFactory, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->_assetRepo = $assetRepo; $this->_localeDate = $localeDate; @@ -90,7 +90,7 @@ public function getConditionFactory() } /** - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php index 489637db0f4c1..94b9f269119ec 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Cancel.php @@ -24,7 +24,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('You have not canceled the item.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php index d7325721c57f1..fd22737d14566 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php @@ -123,7 +123,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); $this->_getSession()->setFormData($data); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('Cannot save the credit memo.')); } $this->_redirect('sales/*/new', ['_current' => true]); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php index 9d67b4d466e30..4db052f51d7bb 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Email.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t send the email order.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php index 061872f8f9cee..24eaeae728018 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/Save.php @@ -188,14 +188,14 @@ public function execute() try { $this->invoiceCommentSender->send($invoice, !empty($data['send_email']), $comment); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('We can\'t send the invoice email.')); } if ($shipment) { try { $this->shipmentSender->send($shipment, !empty($data['send_email'])); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('We can\'t send the shipment.')); } } @@ -206,7 +206,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t save the invoice.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/*/new', ['order_id' => $orderId]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php index 5fe6d8e37ddae..b1507b81be3a3 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/ReviewPayment.php @@ -49,7 +49,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t update the payment.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/order/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php index 6ff2b7c428bba..fc4ed63d9b976 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/View.php @@ -26,7 +26,7 @@ public function execute() $this->_redirect('sales/order/index'); return; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('Exception occurred during order load')); $this->_redirect('sales/order/index'); return; diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php index ae99743a7e4b0..1e30725aa5ea5 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/VoidPayment.php @@ -26,7 +26,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We couldn\'t void the payment.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/*/view', ['order_id' => $order->getId()]); } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php b/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php index 4399974ea79a9..72bdfbd4073f3 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Transactions/Fetch.php @@ -28,7 +28,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t update the transaction details.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('sales/transactions/view', ['_current' => true]); } diff --git a/app/code/Magento/Sales/Model/AbstractNotifier.php b/app/code/Magento/Sales/Model/AbstractNotifier.php index d25db83eed095..d9c808ee4e66d 100644 --- a/app/code/Magento/Sales/Model/AbstractNotifier.php +++ b/app/code/Magento/Sales/Model/AbstractNotifier.php @@ -5,7 +5,7 @@ namespace Magento\Sales\Model; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Mail\Exception; use Magento\Sales\Model\Order\Email\Sender; use Magento\Sales\Model\Resource\Order\Status\History\CollectionFactory; @@ -22,7 +22,7 @@ abstract class AbstractNotifier extends \Magento\Framework\Model\AbstractModel protected $historyCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 761cb20b95b7a..5d06152dd0b3c 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -86,7 +86,7 @@ class Create extends \Magento\Framework\Object implements \Magento\Checkout\Mode protected $_coreRegistry = null; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -200,7 +200,7 @@ class Create extends \Magento\Framework\Object implements \Magento\Checkout\Mode * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Backend\Model\Session\Quote $quoteSession - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Object\Copy $objectCopyService * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param Product\Quote\Initializer $quoteInitializer @@ -226,7 +226,7 @@ public function __construct( \Magento\Framework\Registry $coreRegistry, \Magento\Sales\Model\Config $salesConfig, \Magento\Backend\Model\Session\Quote $quoteSession, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Object\Copy $objectCopyService, \Magento\Framework\Message\ManagerInterface $messageManager, Product\Quote\Initializer $quoteInitializer, diff --git a/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php b/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php index b249f7d7d63d2..9e283b8d52b07 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php +++ b/app/code/Magento/Sales/Model/AdminOrder/EmailSender.php @@ -4,7 +4,7 @@ */ namespace Magento\Sales\Model\AdminOrder; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Message\ManagerInterface; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Sender\OrderSender; diff --git a/app/code/Magento/Sales/Model/Config/Ordered.php b/app/code/Magento/Sales/Model/Config/Ordered.php index 0da1fc08f1006..0664000928495 100644 --- a/app/code/Magento/Sales/Model/Config/Ordered.php +++ b/app/code/Magento/Sales/Model/Config/Ordered.php @@ -59,7 +59,7 @@ abstract class Ordered extends \Magento\Framework\App\Config\Base protected $_configCacheType; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -70,13 +70,13 @@ abstract class Ordered extends \Magento\Framework\App\Config\Base /** * @param \Magento\Framework\App\Cache\Type\Config $configCacheType - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Framework\Simplexml\Element $sourceData */ public function __construct( \Magento\Framework\App\Cache\Type\Config $configCacheType, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Sales\Model\Config $salesConfig, $sourceData = null ) { diff --git a/app/code/Magento/Sales/Model/Order/CreditmemoNotifier.php b/app/code/Magento/Sales/Model/Order/CreditmemoNotifier.php index 97cd87fc60b87..ad1edd48113e6 100644 --- a/app/code/Magento/Sales/Model/Order/CreditmemoNotifier.php +++ b/app/code/Magento/Sales/Model/Order/CreditmemoNotifier.php @@ -5,7 +5,7 @@ namespace Magento\Sales\Model\Order; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender; use Magento\Sales\Model\Resource\Order\Status\History\CollectionFactory; @@ -21,7 +21,7 @@ class CreditmemoNotifier extends \Magento\Sales\Model\AbstractNotifier protected $historyCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Sales/Model/Order/InvoiceNotifier.php b/app/code/Magento/Sales/Model/Order/InvoiceNotifier.php index d8952c48f4766..e9c82ce7c7293 100644 --- a/app/code/Magento/Sales/Model/Order/InvoiceNotifier.php +++ b/app/code/Magento/Sales/Model/Order/InvoiceNotifier.php @@ -5,7 +5,7 @@ namespace Magento\Sales\Model\Order; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; use Magento\Sales\Model\Resource\Order\Status\History\CollectionFactory; @@ -21,7 +21,7 @@ class InvoiceNotifier extends \Magento\Sales\Model\AbstractNotifier protected $historyCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php index f20acae7fc27f..00c098f071f37 100644 --- a/app/code/Magento/Sales/Model/Order/Total/Config/Base.php +++ b/app/code/Magento/Sales/Model/Order/Total/Config/Base.php @@ -37,14 +37,14 @@ class Base extends \Magento\Sales\Model\Config\Ordered /** * @param \Magento\Framework\App\Cache\Type\Config $configCacheType - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory * @param mixed $sourceData */ public function __construct( \Magento\Framework\App\Cache\Type\Config $configCacheType, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Sales\Model\Config $salesConfig, \Magento\Sales\Model\Order\TotalFactory $orderTotalFactory, $sourceData = null diff --git a/app/code/Magento/Sales/Model/OrderNotifier.php b/app/code/Magento/Sales/Model/OrderNotifier.php index 2177000ca1501..317a49b0c5d2c 100644 --- a/app/code/Magento/Sales/Model/OrderNotifier.php +++ b/app/code/Magento/Sales/Model/OrderNotifier.php @@ -5,7 +5,7 @@ namespace Magento\Sales\Model; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Sales\Model\Order\Email\Sender\OrderSender; use Magento\Sales\Model\Resource\Order\Status\History\CollectionFactory; @@ -21,7 +21,7 @@ class OrderNotifier extends \Magento\Sales\Model\AbstractNotifier protected $historyCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php index 7458e105508f4..9c711850919a7 100644 --- a/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php +++ b/app/code/Magento/Sales/Model/Quote/Address/Total/Collector.php @@ -61,7 +61,7 @@ class Collector extends \Magento\Sales\Model\Config\Ordered /** * @param \Magento\Framework\App\Cache\Type\Config $configCacheType - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Sales\Model\Config $salesConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -71,7 +71,7 @@ class Collector extends \Magento\Sales\Model\Config\Ordered */ public function __construct( \Magento\Framework\App\Cache\Type\Config $configCacheType, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Sales\Model\Config $salesConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Collection.php index 3a2e120ca3b35..a27701d5112c8 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Collection.php @@ -35,7 +35,7 @@ class Collection extends AbstractCollection implements OrderSearchResultInterfac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\DB\Helper $coreResourceHelper @@ -44,7 +44,7 @@ class Collection extends AbstractCollection implements OrderSearchResultInterfac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\DB\Helper $coreResourceHelper, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php index 21e235b812607..2cade1f151f74 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Order/Grid/Collection.php @@ -18,7 +18,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Col /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Registry $registryManager @@ -27,7 +27,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\Col */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Registry $registryManager, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php index b4dc1664e44f5..8f3b2f0131828 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Orders/Grid/Collection.php @@ -13,7 +13,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Invoice\Grid\Collec /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Registry $registryManager @@ -22,7 +22,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Invoice\Grid\Collec */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Registry $registryManager, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php index 5afc10aacfae7..b303628884586 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php @@ -28,7 +28,7 @@ class Collection extends AbstractCollection implements OrderPaymentSearchResultI /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Zend_Db_Adapter_Abstract $connection @@ -36,7 +36,7 @@ class Collection extends AbstractCollection implements OrderPaymentSearchResultI */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, $connection = null, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php index 56da2f266f1b8..e5a1677943e36 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Order/Grid/Collection.php @@ -18,7 +18,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Shipment\Grid\Colle /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Registry $registryManager @@ -27,7 +27,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Shipment\Grid\Colle */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Registry $registryManager, diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status.php b/app/code/Magento/Sales/Model/Resource/Order/Status.php index 34a9b9608b362..df6258b3683b0 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status.php @@ -5,7 +5,7 @@ namespace Magento\Sales\Model\Resource\Order; use Magento\Framework\App\Resource; -use Magento\Framework\Logger as LogWriter; +use Psr\Log\LoggerInterface as LogWriter; use Magento\Framework\Model\Exception; /** @@ -30,7 +30,7 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $stateTable; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Address/Rate/Collection.php b/app/code/Magento/Sales/Model/Resource/Quote/Address/Rate/Collection.php index e88135a1bfa0e..e726f76e37c19 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Address/Rate/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Address/Rate/Collection.php @@ -20,7 +20,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory @@ -29,7 +29,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php b/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php index 1aa6352b2238b..979e29328651a 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php @@ -40,7 +40,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Quote\Item\Option\CollectionFactory $itemOptionCollectionFactory @@ -51,7 +51,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Quote\Item\Option\CollectionFactory $itemOptionCollectionFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php b/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php index 178e03ab5dbdb..1a3a1f075433f 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php @@ -11,7 +11,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac { /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Zend_Db_Adapter_Abstract $connection @@ -19,7 +19,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, $connection = null, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 9e9cbc9bb7949..49989878dc42f 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -36,7 +36,7 @@ class Bestsellers extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -47,7 +47,7 @@ class Bestsellers extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php index 73525e8f13a33..16782bc689873 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php @@ -27,7 +27,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -35,7 +35,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php b/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php index d6142402445a6..7a8bd502caaae 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php @@ -20,7 +20,7 @@ class AbstractCollection extends \Magento\Reports\Model\Resource\Report\Collecti /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -28,7 +28,7 @@ class AbstractCollection extends \Magento\Reports\Model\Resource\Report\Collecti */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php index 73be9036f20f1..1f6c851355688 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php @@ -13,7 +13,7 @@ class Invoiced extends Order { /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -21,7 +21,7 @@ class Invoiced extends Order */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index 600501645c53e..f2a9f172b2fa2 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -27,7 +27,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -35,7 +35,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index c18cbf90c5e54..4e8dea3eb1e9d 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -21,7 +21,7 @@ class Order extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -31,7 +31,7 @@ class Order extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php b/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php index 4c6afaa58c819..61143dda0bd00 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php @@ -34,7 +34,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -42,7 +42,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 4c9615483775d..ff0eb84377c04 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -27,7 +27,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -35,7 +35,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php index 820e18229b6cd..d79ab374ac25f 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php @@ -13,7 +13,7 @@ class Refunded extends Order { /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -21,7 +21,7 @@ class Refunded extends Order */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php index a9b72b30be0e0..cedf8781e9069 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -27,7 +27,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -35,7 +35,7 @@ class Order extends \Magento\Sales\Model\Resource\Report\Collection\AbstractColl */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php index ceaf16cf728ba..b2fcd7ac9dc82 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php @@ -13,7 +13,7 @@ class Shipment extends Order { /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -21,7 +21,7 @@ class Shipment extends Order */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php index 99d40d4961df1..d0987f3d99d2c 100644 --- a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php @@ -8,7 +8,7 @@ use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Sales\Model\Resource\Order; /** diff --git a/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php index 438a0998be99b..4f8bb993dbd04 100644 --- a/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Transaction/Grid/Collection.php @@ -16,7 +16,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Payment\Transaction /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Registry $registryManager @@ -25,7 +25,7 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Payment\Transaction */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Registry $registryManager, diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php index 14fbb20f1ff36..cd5fe932c1bfe 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Delete.php @@ -29,7 +29,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while deleting the rule. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('sales_rule/*/edit', ['id' => $this->getRequest()->getParam('id')]); return; } diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php index 4a1b23890b25e..c29d02cc2d3f3 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php @@ -52,7 +52,7 @@ public function execute() $result['error'] = __( 'Something went wrong while generating coupons. Please review the log and try again.' ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } $this->getResponse()->representJson( diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php index f0867046d9310..1aa9ed6cc533d 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php @@ -93,7 +93,7 @@ public function execute() $this->messageManager->addError( __('An error occurred while saving the rule data. Please review the log and try again.') ); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_objectManager->get('Magento\Backend\Model\Session')->setPageData($data); $this->_redirect('sales_rule/*/edit', ['id' => $this->getRequest()->getParam('rule_id')]); return; diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php b/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php index 9e0e726e50166..8ef7dfc1de568 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php @@ -46,7 +46,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -55,7 +55,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index ad81ce6fd4077..43ac17f896e14 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -23,7 +23,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -33,7 +33,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php index b8d8057dd8238..ba0fb345b2692 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php @@ -36,7 +36,7 @@ class Collection extends \Magento\Rule\Model\Resource\Rule\Collection\AbstractCo /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date @@ -45,7 +45,7 @@ class Collection extends \Magento\Rule\Model\Resource\Rule\Collection\AbstractCo */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, diff --git a/app/code/Magento/Search/Model/Resource/Query/Collection.php b/app/code/Magento/Search/Model/Resource/Query/Collection.php index 07dc2a4f169f1..9da9c34b18fb2 100644 --- a/app/code/Magento/Search/Model/Resource/Query/Collection.php +++ b/app/code/Magento/Search/Model/Resource/Query/Collection.php @@ -35,7 +35,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -45,7 +45,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php index 3ea56bc83abf9..5b09369e89f35 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabel.php @@ -64,7 +64,7 @@ public function execute() $response->setError(true); $response->setMessage($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $response->setError(true); $response->setMessage(__('An error occurred while creating shipping label.')); } diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php index 453ebde07a0f8..4058d5f0632c3 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabel.php @@ -95,7 +95,7 @@ public function execute() } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('An error occurred while creating shipping label.')); } $this->_redirect( diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php index 006e63beab57b..893cf57a363b1 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php @@ -143,7 +143,7 @@ public function execute() $this->_redirect('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); } } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); if ($isNeedCreateLabel) { $responseAjax->setError(true); $responseAjax->setMessage(__('An error occurred while creating shipping label.')); diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 7efca7af94521..cb490cc476ca8 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -86,20 +86,20 @@ abstract class AbstractCarrier extends \Magento\Framework\Object implements Abst protected $_rateErrorFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param array $data */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, array $data = [] ) { parent::__construct($data); diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index 061e953250e42..3a8f97aab639e 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -103,7 +103,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -122,7 +122,7 @@ abstract class AbstractCarrierOnline extends AbstractCarrier public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Shipping/Model/ShipmentNotifier.php b/app/code/Magento/Shipping/Model/ShipmentNotifier.php index 6f868b0627f59..38299cb23fc24 100644 --- a/app/code/Magento/Shipping/Model/ShipmentNotifier.php +++ b/app/code/Magento/Shipping/Model/ShipmentNotifier.php @@ -5,7 +5,7 @@ namespace Magento\Shipping\Model; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Sales\Model\Order\Email\Sender\ShipmentSender; use Magento\Sales\Model\Resource\Order\Status\History\CollectionFactory; @@ -21,7 +21,7 @@ class ShipmentNotifier extends \Magento\Sales\Model\AbstractNotifier protected $historyCollectionFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Store/Model/Resource/Config/Collection/Scoped.php b/app/code/Magento/Store/Model/Resource/Config/Collection/Scoped.php index 2e416222c87ac..411d7aa62edd2 100644 --- a/app/code/Magento/Store/Model/Resource/Config/Collection/Scoped.php +++ b/app/code/Magento/Store/Model/Resource/Config/Collection/Scoped.php @@ -24,7 +24,7 @@ class Scoped extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCol /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Resource\Config\Data $resource @@ -34,7 +34,7 @@ class Scoped extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCol */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Core\Model\Resource\Config\Data $resource, diff --git a/app/code/Magento/Store/Model/StorageFactory.php b/app/code/Magento/Store/Model/StorageFactory.php index e7473e2ba7c1a..0ec394d477064 100644 --- a/app/code/Magento/Store/Model/StorageFactory.php +++ b/app/code/Magento/Store/Model/StorageFactory.php @@ -31,7 +31,7 @@ class StorageFactory protected $_eventManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_log; diff --git a/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php b/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php index e9f427e3b0e6f..f70eb49035601 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php @@ -22,7 +22,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -31,7 +31,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Tax/Model/Resource/Report/Collection.php b/app/code/Magento/Tax/Model/Resource/Report/Collection.php index 7ae32523bcc3a..6cdfeb5bf15c3 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Collection.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Collection.php @@ -31,7 +31,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource @@ -39,7 +39,7 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Report $resource, diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index f85c89784ca53..c184dd5bf6e46 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -22,7 +22,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime @@ -32,7 +32,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php index 84520950e44ae..70ac5381a3575 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Delete.php @@ -35,7 +35,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot delete the theme.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } /** * @todo Temporary solution. Theme module should not know about the existence of editor module. diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php index 909a46b10f3f1..a36241655f603 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCss.php @@ -43,7 +43,7 @@ public function execute() } catch (\Exception $e) { $this->messageManager->addException($e, __('File not found: "%1".', $fileId)); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php index 5f2158f8381cb..38f9b1a5c8095 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/DownloadCustomCss.php @@ -41,7 +41,7 @@ public function execute() } catch (\Exception $e) { $this->messageManager->addException($e, __('We cannot find file')); $this->getResponse()->setRedirect($this->_redirect->getRefererUrl()); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php index 9305e1eb450c3..cc443d1d80b1d 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Edit.php @@ -40,7 +40,7 @@ public function execute() $this->_redirect('adminhtml/*/'); } catch (\Exception $e) { $this->messageManager->addError(__('We cannot find the theme.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('adminhtml/*/'); } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php index 91db9e411166d..2c3965ec8cf2e 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/Save.php @@ -69,7 +69,7 @@ public function execute() $redirectBack = true; } catch (\Exception $e) { $this->messageManager->addError('The theme was not saved'); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $redirectBack ? $this->_redirect( 'adminhtml/*/edit', diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php index 14035e572415b..bf7ee434a1095 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadCss.php @@ -23,7 +23,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the CSS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php index 9c40d81733495..6722f35aa165d 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Theme/UploadJs.php @@ -47,7 +47,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('We cannot upload the JS file.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php index da8b2b9c47f75..cd50539d069a4 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/NewFolder.php @@ -22,7 +22,7 @@ public function execute() $result = ['error' => true, 'message' => $e->getMessage()]; } catch (\Exception $e) { $result = ['error' => true, 'message' => __('Sorry, there was an unknown error.')]; - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php index c55290767a4a0..e1bd7a7bec317 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/PreviewImage.php @@ -27,7 +27,7 @@ public function execute() DirectoryList::MEDIA ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('core/index/notFound'); } } diff --git a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php index 55dd0f21069b4..931876210972c 100644 --- a/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php +++ b/app/code/Magento/Theme/Controller/Adminhtml/System/Design/Wysiwyg/Files/TreeJson.php @@ -23,7 +23,7 @@ public function execute() ) ); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode([]) ); diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 64b796628bbd6..0dc097aa355a0 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -159,7 +159,7 @@ public function _createThumbnail($source) $image->resize(self::THUMBNAIL_WIDTH, self::THUMBNAIL_HEIGHT); $image->save($this->mediaWriteDirectory->getAbsolutePath($thumbnailPath)); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); return false; } diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 91cf865456536..2ccb54582ae43 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -105,7 +105,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface protected $_localeFormat; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -117,7 +117,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -138,7 +138,7 @@ class Carrier extends AbstractCarrierOnline implements CarrierInterface public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/UrlRewrite/Model/Resource/UrlRewriteCollection.php b/app/code/Magento/UrlRewrite/Model/Resource/UrlRewriteCollection.php index 0e50c89bf2dbc..ad3059c13eea4 100644 --- a/app/code/Magento/UrlRewrite/Model/Resource/UrlRewriteCollection.php +++ b/app/code/Magento/UrlRewrite/Model/Resource/UrlRewriteCollection.php @@ -17,7 +17,7 @@ class UrlRewriteCollection extends \Magento\Framework\Model\Resource\Db\Collecti /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -26,7 +26,7 @@ class UrlRewriteCollection extends \Magento\Framework\Model\Resource\Db\Collecti */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 11e7aa0a4ef08..a4b61c755e61e 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -115,7 +115,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory * @param \Magento\Shipping\Model\Rate\ResultFactory $rateFactory * @param \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory @@ -137,7 +137,7 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Sales\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, diff --git a/app/code/Magento/Webapi/Controller/ErrorProcessor.php b/app/code/Magento/Webapi/Controller/ErrorProcessor.php index 35d44e282e045..3e951b285ad67 100644 --- a/app/code/Magento/Webapi/Controller/ErrorProcessor.php +++ b/app/code/Magento/Webapi/Controller/ErrorProcessor.php @@ -48,7 +48,7 @@ class ErrorProcessor protected $_appState; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -67,13 +67,13 @@ class ErrorProcessor /** * @param \Magento\Core\Helper\Data $helper * @param \Magento\Framework\App\State $appState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( \Magento\Core\Helper\Data $helper, \Magento\Framework\App\State $appState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem ) { $this->_coreHelper = $helper; diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php index 6c749bd080fcc..447568540595f 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance.php @@ -23,7 +23,7 @@ class Instance extends \Magento\Backend\App\Action protected $_widgetFactory; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -41,7 +41,7 @@ class Instance extends \Magento\Backend\App\Action * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Widget\Model\Widget\InstanceFactory $widgetFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Math\Random $mathRandom * @param \Magento\Framework\Translate\InlineInterface $translateInline */ @@ -49,7 +49,7 @@ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Widget\Model\Widget\InstanceFactory $widgetFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Math\Random $mathRandom, \Magento\Framework\Translate\InlineInterface $translateInline ) { diff --git a/app/code/Magento/Widget/Model/Template/Filter.php b/app/code/Magento/Widget/Model/Template/Filter.php index e5c7aa30374b2..695345a62c8f3 100644 --- a/app/code/Magento/Widget/Model/Template/Filter.php +++ b/app/code/Magento/Widget/Model/Template/Filter.php @@ -21,7 +21,7 @@ class Filter extends \Magento\Cms\Model\Template\Filter /** * @param \Magento\Framework\Stdlib\String $string - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -36,7 +36,7 @@ class Filter extends \Magento\Cms\Model\Template\Filter */ public function __construct( \Magento\Framework\Stdlib\String $string, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, diff --git a/app/code/Magento/Wishlist/Controller/Index/Add.php b/app/code/Magento/Wishlist/Controller/Index/Add.php index 0be01dfee728d..7b45de5f6fdac 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Add.php +++ b/app/code/Magento/Wishlist/Controller/Index/Add.php @@ -127,7 +127,7 @@ public function execute() ); } catch (\Exception $e) { $this->messageManager->addError(__('An error occurred while adding item to wish list.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('*', ['wishlist_id' => $wishlist->getId()]); diff --git a/app/code/Magento/Wishlist/Controller/Index/Configure.php b/app/code/Magento/Wishlist/Controller/Index/Configure.php index 0ff51f62b5784..56e56caff33db 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Configure.php +++ b/app/code/Magento/Wishlist/Controller/Index/Configure.php @@ -99,7 +99,7 @@ public function execute() return; } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t configure the product.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->_redirect('*'); return; } diff --git a/app/code/Magento/Wishlist/Controller/Index/Update.php b/app/code/Magento/Wishlist/Controller/Index/Update.php index c64ae78ed2255..40c1e7dbee43a 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Update.php +++ b/app/code/Magento/Wishlist/Controller/Index/Update.php @@ -94,7 +94,7 @@ public function execute() try { $item->delete(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); $this->messageManager->addError(__('Can\'t delete item from wishlist')); } } diff --git a/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php b/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php index 460577765746c..8d6046d6e938a 100644 --- a/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php +++ b/app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php @@ -99,7 +99,7 @@ public function execute() $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addError(__('An error occurred while updating wish list.')); - $this->_objectManager->get('Magento\Framework\Logger')->critical($e); + $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); } $this->_redirect('*/*', ['wishlist_id' => $wishlist->getId()]); } diff --git a/app/code/Magento/Wishlist/Model/ItemCarrier.php b/app/code/Magento/Wishlist/Model/ItemCarrier.php index 5f843995d111b..a492568b03d80 100644 --- a/app/code/Magento/Wishlist/Model/ItemCarrier.php +++ b/app/code/Magento/Wishlist/Model/ItemCarrier.php @@ -9,7 +9,7 @@ use Magento\Checkout\Model\Cart; use Magento\Customer\Model\Session; use Magento\Framework\App\Response\RedirectInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Message\ManagerInterface as MessageManager; use Magento\Framework\UrlInterface; use Magento\Wishlist\Helper\Data as WishlistHelper; @@ -32,7 +32,7 @@ class ItemCarrier protected $cart; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php index 73bfe66eedfdb..8ab2536a38ad7 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php @@ -131,7 +131,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration @@ -153,7 +153,7 @@ class Collection extends \Magento\Framework\Model\Resource\Db\Collection\Abstrac */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php index c785b0fff9015..06c7bd3b58e57 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php @@ -19,7 +19,7 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection /** * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration @@ -42,7 +42,7 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, diff --git a/dev/tests/functional/lib/Mtf/Util/Generate/Repository/TableCollection.php b/dev/tests/functional/lib/Mtf/Util/Generate/Repository/TableCollection.php index 940de6bd0ff86..f5c9bcbe2d504 100644 --- a/dev/tests/functional/lib/Mtf/Util/Generate/Repository/TableCollection.php +++ b/dev/tests/functional/lib/Mtf/Util/Generate/Repository/TableCollection.php @@ -21,7 +21,7 @@ class TableCollection extends AbstractCollection /** * @constructor * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param null $connection @@ -30,7 +30,7 @@ class TableCollection extends AbstractCollection */ public function __construct( \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, $connection = null, diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 17caa1db0b137..5ecbb875d9931 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -272,10 +272,10 @@ public function initialize($overriddenParams = []) $objectManager->removeSharedInstance('Magento\Framework\Filesystem'); $objectManager->addSharedInstance($filesystem, 'Magento\Framework\Filesystem'); - /** @var \Magento\Framework\Logger $logger */ + /** @var \Psr\Log\LoggerInterface $logger */ $logger = $objectManager->get('Magento\TestFramework\ErrorLog\Logger'); - $objectManager->removeSharedInstance('Magento\Framework\Logger'); - $objectManager->addSharedInstance($logger, 'Magento\Framework\Logger'); + $objectManager->removeSharedInstance('Psr\Log\LoggerInterface'); + $objectManager->addSharedInstance($logger, 'Psr\Log\LoggerInterface'); Helper\Bootstrap::setObjectManager($objectManager); diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php index a74645c54aef3..ce2720accacd8 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php @@ -72,7 +72,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) */ public function startTest(\PHPUnit_Framework_Test $test) { - $this->logger = Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Logger'); + $this->logger = Helper\Bootstrap::getObjectManager()->get('Psr\Log\LoggerInterface'); $this->logger->clearMessages(); } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php index 6cef1344d105f..1b52381998eec 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php @@ -4,7 +4,7 @@ */ namespace Magento\TestFramework\ErrorLog; -class Logger extends \Magento\Framework\Logger +class Logger extends \Psr\Log\LoggerInterface { /** @var array */ protected $messages = []; diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/SessionTest.php index 1b8db05de4677..8c49a3d858962 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/SessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/SessionTest.php @@ -16,7 +16,7 @@ public function testContructor() if (array_key_exists('adminhtml', $_SESSION)) { unset($_SESSION['adminhtml']); } - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Backend\Model\Session', [$logger] diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php index cb7cc49ea3c16..47a3fca574925 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Type/AbstractTypeTest.php @@ -31,7 +31,7 @@ protected function setUp() $fileStorageDb = $this->getMock('Magento\Core\Helper\File\Storage\Database', [], [], '', false); $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $registry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); $this->_model = $this->getMockForAbstractClass( 'Magento\Catalog\Model\Product\Type\AbstractType', [ diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php index 75f463af75981..2ff68a63b48dd 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AddressTest.php @@ -14,7 +14,7 @@ class AddressTest extends \Magento\TestFramework\TestCase\AbstractController protected function setUp() { parent::setUp(); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Customer\Model\Session', [$logger] diff --git a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php index ecfd7fa158df5..cbf2052f709b4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php @@ -43,7 +43,7 @@ protected function setUp() $entityFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Core\Model\EntityFactory' ); - $logger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Logger'); + $logger = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Psr\Log\LoggerInterface'); $this->_model = $this->getMockForAbstractClass( 'Magento\Framework\Model\Resource\Db\Collection\AbstractCollection', diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php index 87bf4d582e650..9e25b21ee91f5 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php @@ -31,7 +31,7 @@ public function testOverviewAction() ->setQuoteId($quote->getId()); $formKey = $this->_objectManager->get('Magento\Framework\Data\Form\FormKey'); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); /** @var $session \Magento\Customer\Model\Session */ $session = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session', [$logger]); diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php index ef9a3150b0ae5..cb860a2a8f25f 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php @@ -17,8 +17,8 @@ public function testPayflowProVoid() $moduleList = $objectManager->get('Magento\Framework\Module\ModuleListInterface'); $paymentData = $objectManager->get('Magento\Payment\Helper\Data'); $scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); - $logger = $objectManager->get('Magento\Framework\Logger'); - $logAdapterFactory = $objectManager->get('Magento\Framework\Logger\AdapterFactory'); + $logger = $objectManager->get('Psr\Log\LoggerInterface'); + $logAdapterFactory = $objectManager->get('Psr\Log\LoggerInterface\AdapterFactory'); $localeDate = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface'); $centinelService = $objectManager->get('Magento\Centinel\Model\Service'); $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Sendfriend/Block/SendTest.php b/dev/tests/integration/testsuite/Magento/Sendfriend/Block/SendTest.php index c0f8365317556..2e88e9f1fd658 100644 --- a/dev/tests/integration/testsuite/Magento/Sendfriend/Block/SendTest.php +++ b/dev/tests/integration/testsuite/Magento/Sendfriend/Block/SendTest.php @@ -53,7 +53,7 @@ public function formDataProvider() */ public function testGetCustomerFieldFromSession($field, $value) { - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); /** @var $session \Magento\Customer\Model\Session */ $session = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session', [$logger]); /** @var \Magento\Customer\Api\AccountManagementInterface $service */ diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php index 22e3403aa81bc..21aca63de4529 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/InlineParserTest.php @@ -62,7 +62,7 @@ public function testProcessAjaxPost($originalText, $translatedText, $isPerStore } catch (\Exception $e) { $model->delete(); \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\Logger') + ->get('Psr\Log\LoggerInterface') ->critical($e); } } diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php index 3fea90233aa3f..26cb4a3747ab7 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php @@ -24,7 +24,7 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractController protected function setUp() { parent::setUp(); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false); $this->_customerSession = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( 'Magento\Customer\Model\Session', [$logger] diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 68e501b6893bb..b80740de2d0f2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -1724,7 +1724,7 @@ ['Magento\Adminhtml\Block\Report\Wishlist', 'Magento\Reports\Block\Adminhtml\Wishlist'], ['Magento\Backend\Helper\Addresses'], ['Magento\Core\Model\Cookie', 'Magento\Framework\Stdlib\Cookie'], - ['Magento\Core\Model\Logger', 'Magento\Framework\Logger'], + ['Magento\Core\Model\Logger', 'Psr\Log\LoggerInterface'], ['Magento\Core\Block\Template\Context', 'Magento\Framework\View\Element\Template\Context'], ['Magento\Page\Block\Template\Container'], ['Magento\Page\Block\Redirect', 'Magento\Framework\View\Element\Redirect'], @@ -1980,7 +1980,7 @@ ['Magento\Core\Model\Image\Adapter\Config', 'Magento\Framework\Image\Adapter\Config'], ['Magento\Core\Model\AbstractShell', 'Magento\Framework\App\AbstractShell'], ['Magento\Core\Model\Calculator', 'Magento\Framework\Math\Calculator'], - ['Magento\Core\Model\Log\Adapter', 'Magento\Framework\Logger\Adapter'], + ['Magento\Core\Model\Log\Adapter', 'Psr\Log\LoggerInterface\Adapter'], ['Magento\Core\Model\Input\Filter', 'Magento\Framework\Filter\Input'], ['Magento\Core\Model\Input\Filter\MaliciousCode', 'Magento\Framework\Filter\Input\MaliciousCode'], ['Magento\Core\Model\Option\ArrayInterface', 'Magento\Framework\Option\ArrayInterface'], @@ -2330,7 +2330,7 @@ ['Magento\Locale', 'Magento\Framework\Locale'], ['Magento\LocaleFactory', 'Magento\Framework\LocaleFactory'], ['Magento\LocaleInterface', 'Magento\Framework\LocaleInterface'], - ['Magento\Logger', 'Magento\Framework\Logger'], + ['Magento\Logger', 'Psr\Log\LoggerInterface'], ['Magento\Phrase', 'Magento\Framework\Phrase'], ['Magento\Pear', 'Magento\Framework\Pear'], [ diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php index 6892d99ff7d20..469e282ce54fa 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php @@ -28,7 +28,7 @@ ['Magento\Phrase', 'Magento\Framework\Phrase'], ['Magento\Locale', 'Magento\Framework\Locale'], ['Magento\Message', 'Magento\Framework\Message'], - ['Magento\Logger', 'Magento\Framework\Logger'], + ['Magento\Logger', 'Psr\Log\LoggerInterface'], ['Magento\Error', 'Magento\Framework\Error'], ['Magento\Filter', 'Magento\Framework\Filter'], ['Magento\DomDocument', 'Magento\Framework\DomDocument'], diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php index 06922811fcf6b..9edcd2c881a18 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php @@ -22,7 +22,7 @@ ['_childGroups', 'Magento\Core\Block\AbstractBlock'], ['_combineHistory'], ['_config', 'Magento\Core\Model\Design\Package'], - ['_config', 'Magento\Framework\Logger', '_dirs'], + ['_config', 'Psr\Log\LoggerInterface', '_dirs'], ['_config', 'Magento\Core\Model\Resource\Setup'], ['_configModel', 'Magento\Backend\Model\Menu\AbstractDirector'], ['_connectionConfig', 'Magento\Core\Model\Resource\Setup'], diff --git a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php index 8080328c0f1ae..865cc78c1d92f 100644 --- a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php +++ b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php @@ -82,7 +82,7 @@ protected function setUp() $this->_urlMock = $this->_makeMock('Magento\Framework\UrlInterface'); $this->_eventManagerMock = $this->_makeMock('Magento\Framework\Event\ManagerInterface'); $this->_controllerMock = $this->_makeMock('Magento\Framework\App\FrontController'); - $this->_loggerMock = $this->_makeMock('Magento\Framework\Logger'); + $this->_loggerMock = $this->_makeMock('Psr\Log\LoggerInterface'); $this->_filesystemMock = $this->_makeMock('Magento\Framework\Filesystem'); $this->_cacheMock = $this->_makeMock('Magento\Framework\App\CacheInterface'); $this->_scopeConfigMock = $this->_makeMock('Magento\Framework\App\Config\ScopeConfigInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Authorization/Model/Acl/AclRetrieverTest.php b/dev/tests/unit/testsuite/Magento/Authorization/Model/Acl/AclRetrieverTest.php index 72906ff1a521e..a1e39651e6208 100644 --- a/dev/tests/unit/testsuite/Magento/Authorization/Model/Acl/AclRetrieverTest.php +++ b/dev/tests/unit/testsuite/Magento/Authorization/Model/Acl/AclRetrieverTest.php @@ -165,7 +165,7 @@ protected function createAclRetriever() $aclBuilderMock, $roleCollectionFactoryMock, $rulesCollectionFactoryMock, - $this->getMock('Magento\Framework\Logger', [], [], '', false) + $this->getMock('Psr\Log\LoggerInterface') ); } } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php index 7c5a367fbfbcd..58b3541dd4cf0 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/TunnelTest.php @@ -142,11 +142,11 @@ public function testTunnelAction503() ->method('create') ->with('Magento\Framework\HTTP\ZendClient') ->will($this->throwException($exceptionMock)); - $loggerMock = $this->getMock('Magento\Framework\Logger', ['critical'], [], '', false); + $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $loggerMock->expects($this->once())->method('critical')->with($exceptionMock); $this->_objectManager->expects($this->at(2)) ->method('get') - ->with('Magento\Framework\Logger') + ->with('Psr\Log\LoggerInterface') ->will($this->returnValue($loggerMock)); $controller = $this->_factory($this->_request, $this->_response); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php index 4434ebbb8ee12..dc5dd79a794c3 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php @@ -11,7 +11,7 @@ public function testSaveMergedJsCssMustBeCleaned() $eventDispatcher = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $appState = $this->getMock('Magento\Framework\App\State', [], [], '', false); $cacheManager = $this->getMock('Magento\Framework\App\CacheInterface'); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $actionValidatorMock = $this->getMock( 'Magento\Framework\Model\ActionValidator\RemoveAction', [], diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php index d1a38f433c5f5..8d8c30a7dd7ea 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php @@ -11,7 +11,7 @@ public function testSaveMergedJsCssMustBeCleaned() $eventDispatcher = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $appState = $this->getMock('Magento\Framework\App\State', [], [], '', false); $cacheManager = $this->getMock('Magento\Framework\App\CacheInterface'); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $actionValidatorMock = $this->getMock( '\Magento\Framework\Model\ActionValidator\RemoveAction', [], diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Admin/PageTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Admin/PageTest.php index 1fff5d361bb37..7e7fbee400dba 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Admin/PageTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Source/Admin/PageTest.php @@ -32,7 +32,7 @@ class PageTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_menuModel = new \Magento\Backend\Model\Menu($logger); $this->_menuSubModel = new \Magento\Backend\Model\Menu($logger); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/BuilderTest.php index 25e7413aa295d..b4880b7154cb4 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/BuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/BuilderTest.php @@ -27,7 +27,7 @@ protected function setUp() $this->_menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $this->_model = new \Magento\Backend\Model\Menu\Builder($this->_factoryMock, $this->_menuMock); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php index e3aa7a064ac8b..bc5f314e0618d 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ConfigTest.php @@ -94,18 +94,12 @@ protected function setUp() false ); - $this->_logger = $this->getMock( - 'Magento\Framework\Logger', - ['addStoreLog', 'log', 'critical'], - [], - '', - false - ); + $this->_logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $this->_menuBuilderMock = $this->getMock('Magento\Backend\Model\Menu\Builder', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php index 452d3d5071fac..696043006c9bc 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Director/DirectorTest.php @@ -38,13 +38,7 @@ class DirectorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_builderMock = $this->getMock('Magento\Backend\Model\Menu\Builder', [], [], '', false); - $this->_logger = $this->getMock( - 'Magento\Framework\Logger', - ['debug', 'info', 'critical'], - [], - '', - false - ); + $this->_logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_commandMock = $this->getMock( 'Magento\Backend\Model\Menu\Builder\AbstractCommand', ['getId', '_execute', 'execute', 'chain'], diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Filter/IteratorTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Filter/IteratorTest.php index a1f3c38ae4a63..080cd564b174e 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Filter/IteratorTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/Filter/IteratorTest.php @@ -38,7 +38,7 @@ protected function setUp() $this->_items['item3']->expects($this->any())->method('isDisabled')->will($this->returnValue(false)); $this->_items['item3']->expects($this->any())->method('isAllowed')->will($this->returnValue(false)); - $loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->_menuModel = new \Magento\Backend\Model\Menu($loggerMock); $this->_filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator( diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php index e7ce46a61dcaa..30d52ab0419da 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Menu/ItemTest.php @@ -217,7 +217,7 @@ public function testGetChildrenCreatesSubmenuOnFirstCall() $menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $this->_menuFactoryMock->expects($this->once())->method('create')->will($this->returnValue($menuMock)); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php index 3812e291ded0e..f788228c365be 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/MenuTest.php @@ -12,7 +12,7 @@ class MenuTest extends \PHPUnit_Framework_TestCase protected $_model; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -32,7 +32,7 @@ protected function setUp() $this->_items['item3'] = $this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false); $this->_items['item3']->expects($this->any())->method('getId')->will($this->returnValue('item3')); - $this->_logger = $this->getMock('Magento\Framework\Logger', ['info'], [], '', false); + $this->_logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_model = new \Magento\Backend\Model\Menu($this->_logger); } @@ -47,14 +47,6 @@ public function testAdd() public function testAddDoLogAddAction() { - $this->_logger->expects( - $this->once() - )->method( - 'info' - )->with( - $this->equalTo(sprintf('Add of item with id %s was processed', $this->_items['item1']->getId())) - ); - $this->_model->add($this->_items['item1']); } @@ -136,7 +128,7 @@ public function testMove() $subMenu = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $subMenu->expects($this->once())->method("add")->with($this->_items['item3']); @@ -189,7 +181,7 @@ public function testRemoveRemovesMenuItemRecursively() $menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $menuMock->expects($this->once())->method('remove')->with($this->equalTo('item2')); @@ -203,15 +195,6 @@ public function testRemoveRemovesMenuItemRecursively() public function testRemoveDoLogRemoveAction() { $this->_model->add($this->_items['item1']); - - $this->_logger->expects( - $this->once() - )->method( - 'info' - )->with( - $this->equalTo(sprintf('Remove on item with id %s was processed', $this->_items['item1']->getId())) - ); - $this->_model->remove('item1'); } @@ -335,7 +318,6 @@ public function testNestedLoop() public function testSerialize() { $this->assertNotEmpty($this->_model->serialize()); - $this->_logger->expects($this->once())->method('info'); $this->_model->add($this->_items['item1']); } } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php index a06bdd16060f8..74d4b10a1eb72 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php @@ -77,7 +77,7 @@ protected function setUp() $this->_menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $this->_menuConfigMock = $this->getMock('Magento\Backend\Model\Menu\Config', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php index aea23a0b5ca4d..cc5bec710735f 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Adminhtml/Product/BuilderTest.php @@ -43,7 +43,7 @@ class BuilderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', ['create'], [], '', false); $this->registryMock = $this->getMock('Magento\Framework\Registry', [], [], '', false); $this->wysiwygConfigMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php index 208968354742a..716996ecadc9d 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/SimpleTest.php @@ -21,7 +21,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $coreRegistry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $this->_model = $objectHelper->getObject( 'Magento\Catalog\Model\Product\Type\Simple', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php index b8f01b46c8683..3bcc6208d1467 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Type/VirtualTest.php @@ -21,7 +21,7 @@ protected function setUp() $filesystem = $this->getMockBuilder('Magento\Framework\Filesystem') ->disableOriginalConstructor() ->getMock(); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $this->_model = $objectHelper->getObject( 'Magento\Catalog\Model\Product\Type\Virtual', diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Link/Product/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Link/Product/CollectionTest.php index b49d56d50d073..f57e9360912cd 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Link/Product/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Link/Product/CollectionTest.php @@ -76,7 +76,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'); $this->managerInterfaceMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); $this->configMock = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/CollectionTest.php index 878c7e23d4534..cbaa98332060e 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/CollectionTest.php @@ -12,7 +12,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $collection; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -61,7 +61,7 @@ protected function setUp() $this->entityFactoryMock = $this->getMock( 'Magento\Core\Model\EntityFactory', ['create'], [], '', false ); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock( 'Magento\Framework\Data\Collection\Db\FetchStrategy\Query', ['fetchAll'], [], '', false ); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php index f7b481eb9fef0..930c7fcbd5b8a 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBoxTest.php @@ -41,7 +41,7 @@ class FinalPriceBoxTest extends \PHPUnit_Framework_TestCase protected $product; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $logger; @@ -74,7 +74,7 @@ protected function setUp() $this->layout = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); $this->priceBox = $this->getMock('Magento\Framework\Pricing\Render\PriceBox', [], [], '', false); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->layout->expects($this->any()) ->method('getBlock') diff --git a/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php b/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php index 00d68c8f7807e..f43f149879581 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/OptionTest.php @@ -381,7 +381,7 @@ protected function _getSourceDataMocks($addExpectations, $doubleOptions) 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', ['fetchAll'] ); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); $optionCollection = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php index 7db6a77aa9e3e..294315836209f 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Model/Type/OnepageTest.php @@ -28,7 +28,7 @@ class OnepageTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Model\Url|\PHPUnit_Framework_MockObject_MockObject */ protected $customerUrlMock; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; /** @var \Magento\Checkout\Model\Session|\PHPUnit_Framework_MockObject_MockObject */ @@ -113,7 +113,7 @@ protected function setUp() $this->eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); $this->checkoutHelperMock = $this->getMock('Magento\Checkout\Helper\Data', [], [], '', false); $this->customerUrlMock = $this->getMock('Magento\Customer\Model\Url', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->checkoutSessionMock = $this->getMock( 'Magento\Checkout\Model\Session', ['getLastOrderId', 'getQuote', 'setStepData', 'getStepData'], diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/Billing/WriteServiceTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/Billing/WriteServiceTest.php index 688ceb111d5b9..4635856766682 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/Billing/WriteServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Service/V1/Address/Billing/WriteServiceTest.php @@ -69,7 +69,7 @@ protected function setUp() '\Magento\Checkout\Service\V1\Address\Converter', [], [], '', false ); - $this->loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $this->service = new \Magento\Checkout\Service\V1\Address\Billing\WriteService( $this->quoteRepositoryMock, diff --git a/dev/tests/unit/testsuite/Magento/Cms/Model/Resource/PageCriteriaMapperTest.php b/dev/tests/unit/testsuite/Magento/Cms/Model/Resource/PageCriteriaMapperTest.php index 1affb8ae653b1..1db747a91061d 100644 --- a/dev/tests/unit/testsuite/Magento/Cms/Model/Resource/PageCriteriaMapperTest.php +++ b/dev/tests/unit/testsuite/Magento/Cms/Model/Resource/PageCriteriaMapperTest.php @@ -10,7 +10,7 @@ class PageCriteriaMapperTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -46,13 +46,7 @@ class PageCriteriaMapperTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - [], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMockForAbstractClass( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', [], diff --git a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php index 2f072bd8810f7..7f282cceff00a 100644 --- a/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php @@ -51,7 +51,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $coreRegistry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $this->_typeConfigurableFactory = $this->getMock( 'Magento\ConfigurableProduct\Model\Resource\Product\Type\ConfigurableFactory', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php index ee220db6174da..24c78c03786b3 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/Directory/DatabaseTest.php @@ -55,7 +55,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase protected $resourceDirectoryDatabaseMock; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $loggerMock; @@ -106,7 +106,7 @@ protected function setUp() '', false ); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->directoryFactoryMock->expects( $this->any() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/MediaTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/MediaTest.php index 86d283fc25bd1..ae0ed046c2bae 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/MediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/MediaTest.php @@ -36,7 +36,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->_loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->_storageHelperMock = $this->getMock( 'Magento\Core\Helper\File\Storage\Database', [], diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index e64c7edb5c8af..028bec513f8fb 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -79,7 +79,7 @@ protected function setUp() $this->_appState = $this->getMock('Magento\Framework\App\State', [], [], '', false); - $this->_logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->_logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_layoutValidator = $this->getMock( 'Magento\Core\Model\Layout\Update\Validator', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php index 343573b5df69f..5f61a0eddc9f8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php @@ -36,7 +36,7 @@ class FileTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->filesystemMock = $this->getMock( 'Magento\Framework\Filesystem', ['getDirectoryRead'], diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php index 85a97321f6028..d606ae998b9f3 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php @@ -28,7 +28,7 @@ protected function _getCollection(\Zend_Db_Select $select) return new \Magento\Core\Model\Resource\Layout\Link\Collection( $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false), - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMockForAbstractClass('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'), $eventManager, $this->getMock('Magento\Framework\Stdlib\DateTime', null, [], '', true), diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php index 06ae56f3b048f..34d7145aafd3c 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php @@ -18,7 +18,7 @@ protected function _getCollection(\Zend_Db_Select $select) return new \Magento\Core\Model\Resource\Layout\Update\Collection( $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false), - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMockForAbstractClass('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'), $eventManager, $this->getMock('Magento\Framework\Stdlib\DateTime', null, [], '', true), diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Data/PostcodeTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Data/PostcodeTest.php index d5b34e20715f8..fd40eb5504a8f 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Data/PostcodeTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Data/PostcodeTest.php @@ -31,7 +31,7 @@ class PostcodeTest extends \PHPUnit_Framework_TestCase private $localeResolverMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $loggerMock; @@ -41,8 +41,7 @@ protected function setUp() ->getMock(); $this->localeResolverMock = $this->getMockBuilder('Magento\Framework\Locale\ResolverInterface') ->getMock(); - $this->loggerMock = $this->getMockBuilder('Magento\Framework\Logger') - ->disableOriginalConstructor() + $this->loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface') ->getMock(); $this->directoryHelperMock = $this->getMockBuilder('Magento\Directory\Helper\Data') ->disableOriginalConstructor() diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/BillingTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/BillingTest.php index 21d44a8283eb0..15a2fb85938aa 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/BillingTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/BillingTest.php @@ -13,8 +13,8 @@ class BillingTest extends \PHPUnit_Framework_TestCase public function setUp() { - $logger = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); - /** @var \Magento\Framework\Logger $logger */ + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + /** @var \Psr\Log\LoggerInterface $logger */ $this->testable = new Billing($logger); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/ShippingTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/ShippingTest.php index 463632cb97d94..c4dcd2f89ae72 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/ShippingTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Customer/Attribute/Backend/ShippingTest.php @@ -14,8 +14,8 @@ class ShippingTest extends \PHPUnit_Framework_TestCase public function setUp() { - $logger = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); - /** @var \Magento\Framework\Logger $logger */ + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + /** @var \Psr\Log\LoggerInterface $logger */ $this->testable = new Shipping($logger); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php index 41b751c72a043..937392319dc76 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractDataTest.php @@ -19,7 +19,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Locale\ResolverInterface */ protected $_localeResolverMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Logger */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Psr\Log\LoggerInterface */ protected $_loggerMock; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Api\Data\AttributeMetadataInterface */ @@ -42,7 +42,7 @@ protected function setUp() $this->_localeResolverMock = $this->getMockBuilder( 'Magento\Framework\Locale\ResolverInterface' )->disableOriginalConstructor()->getMock(); - $this->_loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); + $this->_loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $this->_attributeMock = $this->getMock('Magento\Customer\Api\Data\AttributeMetadataInterface'); $this->_value = 'VALUE'; $this->_entityTypeCode = 'ENTITY_TYPE_CODE'; diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractFormTestCase.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractFormTestCase.php index 827aa69df61dd..eea536eb7e0a8 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractFormTestCase.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Metadata/Form/AbstractFormTestCase.php @@ -13,7 +13,7 @@ abstract class AbstractFormTestCase extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Locale\ResolverInterface */ protected $localeResolverMock; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Logger */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Psr\Log\LoggerInterface */ protected $loggerMock; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Api\Data\AttributeMetadataInterface */ @@ -23,7 +23,7 @@ protected function setUp() { $this->localeMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\TimezoneInterface')->getMock(); $this->localeResolverMock = $this->getMockBuilder('Magento\Framework\Locale\ResolverInterface')->getMock(); - $this->loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); + $this->loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $this->attributeMetadataMock = $this->getMock('Magento\Customer\Api\Data\AttributeMetadataInterface'); } } diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php index 6b644e2703ffa..52490c8b7964f 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/PriceCurrencyTest.php @@ -33,8 +33,7 @@ public function setUp() ->setMethods(['create']) ->getMock(); - $this->logger = $this->getMockBuilder('Magento\Framework\Logger') - ->disableOriginalConstructor() + $this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface') ->getMock(); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php index 0d46c4bec543a..00158413afe0d 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php @@ -35,7 +35,7 @@ protected function setUp() $fetchStrategy = $this->getMockForAbstractClass('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'); $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); $scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $countryFactory = $this->getMock( 'Magento\Directory\Model\Resource\CountryFactory', [], diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php index c5ac347e6e322..2542ded81899f 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php @@ -26,7 +26,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $coreRegistry = $this->getMock('Magento\Framework\Registry', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $sampleResFactory = $this->getMock('Magento\Downloadable\Model\Resource\SampleFactory', [], [], '', false); $linkResource = $this->getMock('Magento\Downloadable\Model\Resource\Link', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/AbstractDataTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/AbstractDataTest.php index 01669f34e3def..f1d427f3744bb 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/AbstractDataTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/AbstractDataTest.php @@ -14,7 +14,7 @@ class AbstractDataTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $stringMock = $this->getMock('\Magento\Framework\Stdlib\String', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/BooleanTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/BooleanTest.php index 6b5d884332806..0c8ead39311ad 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/BooleanTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/BooleanTest.php @@ -14,7 +14,7 @@ class BooleanTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->model = new Boolean($timezoneMock, $loggerMock, $localeResolverMock); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/DateTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/DateTest.php index 4932899f05552..6bb94af2800ed 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/DateTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/DateTest.php @@ -19,7 +19,7 @@ class DateTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->model = new Date($this->timezoneMock, $loggerMock, $localeResolverMock); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/FileTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/FileTest.php index 70370559083bf..1560e4e304855 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/FileTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/FileTest.php @@ -24,7 +24,7 @@ class FileTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->urlEncoder = $this->getMock('Magento\Framework\Url\EncoderInterface', [], [], '', false); $this->fileValidatorMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/ImageTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/ImageTest.php index 59cb2a0d1475e..626e8b9968376 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/ImageTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/ImageTest.php @@ -14,7 +14,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $urlEncoder = $this->getMock('Magento\Framework\Url\EncoderInterface', [], [], '', false); $fileValidatorMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php index 0e6e1e1f20fd8..7871eef64e542 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultilineTest.php @@ -19,7 +19,7 @@ class MultilineTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->stringMock = $this->getMock('\Magento\Framework\Stdlib\String', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultiselectTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultiselectTest.php index 6304d8fb15387..969ebfcfd5da6 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultiselectTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/MultiselectTest.php @@ -14,7 +14,7 @@ class MultiselectTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->model = new Multiselect($timezoneMock, $loggerMock, $localeResolverMock); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/SelectTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/SelectTest.php index 5500ddd0bb7e5..611c5c81d2158 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/SelectTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/SelectTest.php @@ -14,7 +14,7 @@ class SelectTest extends \PHPUnit_Framework_TestCase protected function setUp() { $timezoneMock = $this->getMock('\Magento\Framework\Stdlib\DateTime\TimezoneInterface'); - $loggerMock = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $localeResolverMock = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $this->model = new Select($timezoneMock, $loggerMock, $localeResolverMock); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/TextTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/TextTest.php index bd6504e7eea1e..8b02bb74601d1 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/TextTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Attribute/Data/TextTest.php @@ -29,7 +29,7 @@ protected function setUp() false, false ); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false, false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $helper = $this->getMock('Magento\Framework\Stdlib\String', [], [], '', false, false); $attributeData = [ diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php index 00cc2d8ec139b..6d83b5cf56870 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php @@ -25,7 +25,7 @@ protected function setUp() '', false ); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_model = new \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend($logger); $this->_model->setAttribute($this->_attribute); } diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php index 643be759694cb..8c2fbd95ed9c5 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Collection/AbstractCollectionTest.php @@ -17,7 +17,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected $coreEntityFactoryMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -59,7 +59,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->coreEntityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', [], diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Attribute/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Attribute/CollectionTest.php index 0d712466ff20d..f71b2d4fd7174 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Attribute/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Attribute/CollectionTest.php @@ -17,7 +17,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $entityFactoryMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -64,7 +64,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'); $this->eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php index 7d2313e46b0aa..5e27db60b517f 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/Option/CollectionTest.php @@ -17,7 +17,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $entityFactoryMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -59,7 +59,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', [], diff --git a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php index 8b54b0509e576..12105ab2f5527 100644 --- a/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/Email/Block/Adminhtml/Template/EditTest.php @@ -52,7 +52,7 @@ protected function setUp() $menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $menuItemMock = $this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false, false); $urlBuilder = $this->getMock('Magento\Backend\Model\Url', [], [], '', false, false); diff --git a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php index 4bb9d7ee7e9a4..9e28c26b13e83 100644 --- a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php @@ -77,7 +77,7 @@ function ($price) { 'scopeConfig' => $scopeConfig, 'rateErrorFactory' => $this->getMock('Magento\Sales\Model\Quote\Address\RateResult\ErrorFactory', [], [], '', false), - 'logger' => $this->getMock('Magento\Framework\Logger', [], [], '', false), + 'logger' => $this->getMock('Psr\Log\LoggerInterface'), 'xmlElFactory' => $this->getMock('Magento\Shipping\Model\Simplexml\ElementFactory', [], [], '', false), 'rateFactory' => $rateFactory, 'rateMethodFactory' => $rateMethodFactory, diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/BootstrapTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/BootstrapTest.php index 11b5ff8d5ea3a..986ad6a02af56 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/BootstrapTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/BootstrapTest.php @@ -25,7 +25,7 @@ class BootstrapTest extends \PHPUnit_Framework_TestCase protected $objectManager; /** - * @var \Magento\Framework\Logger | \PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $logger; @@ -62,7 +62,7 @@ public function setUp() $this->maintenanceMode = $this->getMock('Magento\Framework\App\MaintenanceMode', ['isOn'], [], '', false); $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); @@ -71,7 +71,7 @@ public function setUp() ['Magento\Framework\App\MaintenanceMode', $this->maintenanceMode], ['Magento\Framework\Filesystem', $filesystem], ['Magento\Framework\App\DeploymentConfig', $this->deploymentConfig], - ['Magento\Framework\Logger', $this->logger], + ['Psr\Log\LoggerInterface', $this->logger], ]; $this->objectManager->expects($this->any())->method('get') diff --git a/dev/tests/unit/testsuite/Magento/Framework/DB/AbstractMapperTest.php b/dev/tests/unit/testsuite/Magento/Framework/DB/AbstractMapperTest.php index 9a97d863332b5..7ccd46efefa56 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/DB/AbstractMapperTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/DB/AbstractMapperTest.php @@ -25,7 +25,7 @@ class AbstractMapperTest extends \PHPUnit_Framework_TestCase protected $selectMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -81,13 +81,7 @@ protected function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - [], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMockForAbstractClass( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', [], diff --git a/dev/tests/unit/testsuite/Magento/Framework/DB/QueryTest.php b/dev/tests/unit/testsuite/Magento/Framework/DB/QueryTest.php index 799e194e822e0..fa8981c85e39c 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/DB/QueryTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/DB/QueryTest.php @@ -30,7 +30,7 @@ class QueryTest extends \PHPUnit_Framework_TestCase protected $fetchStmtMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -85,13 +85,7 @@ protected function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - [], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMockForAbstractClass( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', [], diff --git a/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php b/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php index a261fa3694d93..34dbe81ac5930 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Data/Collection/DbTest.php @@ -12,7 +12,7 @@ class DbTest extends \PHPUnit_Framework_TestCase protected $collection; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -34,7 +34,7 @@ protected function setUp() $this->entityFactoryMock = $this->getMock( 'Magento\Core\Model\EntityFactory', ['create'], [], '', false ); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', ['info'], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->collection = new \Magento\Framework\Data\Collection\Db( $this->entityFactoryMock, $this->loggerMock, diff --git a/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractExtensibleModelTest.php b/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractExtensibleModelTest.php index 98eacb609f309..26c1423a96627 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractExtensibleModelTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractExtensibleModelTest.php @@ -55,7 +55,7 @@ protected function setUp() false ); $this->contextMock = new \Magento\Framework\Model\Context( - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false), $this->getMock('Magento\Framework\App\CacheInterface', [], [], '', false), $this->getMock('Magento\Framework\App\State', [], [], '', false), diff --git a/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractModelTest.php b/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractModelTest.php index 708eeda02c873..2d2109a4b6e29 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractModelTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Model/AbstractModelTest.php @@ -53,7 +53,7 @@ protected function setUp() false ); $this->contextMock = new \Magento\Framework\Model\Context( - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false), $this->getMock('Magento\Framework\App\CacheInterface', [], [], '', false), $this->getMock('Magento\Framework\App\State', [], [], '', false), diff --git a/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractCollectionTest.php b/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractCollectionTest.php index 3d6b52266b576..8212036d79cc1 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractCollectionTest.php @@ -21,7 +21,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\Data\Collection\EntityFactoryInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $entityFactoryMock; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; /** @var \Magento\Framework\Data\Collection\Db\FetchStrategyInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -45,7 +45,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->entityFactoryMock = $this->getMock('Magento\Framework\Data\Collection\EntityFactoryInterface'); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategyMock = $this->getMock('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'); $this->managerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); $this->connectionMock = $this->getMock('Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/Setup/MigrationTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/Setup/MigrationTest.php index 29b126f121eb4..455753f860ecf 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/Setup/MigrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/Setup/MigrationTest.php @@ -159,7 +159,7 @@ public function testAppendClassAliasReplace() ->will($this->returnValue($this->getMock('Magento\Framework\App\Resource', [], [], '', false))); $contextMock->expects($this->once()) ->method('getLogger') - ->will($this->returnValue($this->getMock('Magento\Framework\Logger', [], [], '', false))); + ->will($this->returnValue($this->getMock('Psr\Log\LoggerInterface'))); $contextMock->expects($this->once()) ->method('getModulesReader') ->will( @@ -216,7 +216,7 @@ public function testDoUpdateClassAliases($replaceRules, $tableData, $expected, $ $this->getMock('Magento\Framework\App\Resource', [], [], '', false, false), $this->getMock('Magento\Framework\Filesystem', [], [], '', false), $this->getMock('Magento\Core\Helper\Data', [], [], '', false), - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false), $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'), $this->getMock('Magento\Framework\Module\ModuleListInterface'), diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php index f83923b7fe301..0075409fc18f5 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MergedTest.php @@ -48,7 +48,7 @@ protected function setUp() $this->_assetJsTwo->expects($this->any())->method('getPath') ->will($this->returnValue('script_two.js')); - $this->_logger = $this->getMock('Magento\Framework\Logger', ['critical'], [], '', false); + $this->_logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_mergeStrategy = $this->getMock('Magento\Framework\View\Asset\MergeStrategyInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php index c9225cec514c6..953d28830ee18 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Asset/MinifiedTest.php @@ -14,7 +14,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase protected $_asset; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_logger; @@ -51,7 +51,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_asset = $this->getMockForAbstractClass('\Magento\Framework\View\Asset\LocalInterface'); - $this->_logger = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $this->_logger = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $this->_baseUrl = $this->getMock('\Magento\Framework\Url', [], [], '', false); $this->_staticViewDir = $this->getMockForAbstractClass( '\Magento\Framework\Filesystem\Directory\WriteInterface' diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/ContextTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/ContextTest.php index 79bf24db6497e..a5e76e1716f57 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/ContextTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/ContextTest.php @@ -117,7 +117,7 @@ public function testGetCacheState() public function testGetLogger() { - $this->assertInstanceOf('\Magento\Framework\Logger', $this->context->getLogger()); + $this->assertInstanceOf('\Psr\Log\LoggerInterface', $this->context->getLogger()); } public function testGetAppState() diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Design/Theme/ImageTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Design/Theme/ImageTest.php index e3ab232cf713d..406399dfcdadc 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Design/Theme/ImageTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Design/Theme/ImageTest.php @@ -86,7 +86,7 @@ protected function setUp() $this->_imageMock = $this->getMock('Magento\Framework\Image', [], [], '', false, false); $imageFactory->expects($this->any())->method('create')->will($this->returnValue($this->_imageMock)); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false, false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $this->_themeMock = $this->getMock('Magento\Core\Model\Theme', ['__wakeup'], [], '', false, false); $this->_uploaderMock = $this->getMock( 'Magento\Framework\View\Design\Theme\Image\Uploader', diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php index 70bfc7346e0d0..64e3254b0bc97 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/RendererTest.php @@ -56,7 +56,7 @@ class RendererTest extends \PHPUnit_Framework_TestCase protected $stringMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -106,8 +106,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->loggerMock = $this->getMockBuilder('Magento\Framework\Logger') - ->disableOriginalConstructor() + $this->loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface') ->getMock(); $this->assetsCollection = $this->getMockBuilder('Magento\Framework\View\Asset\GroupedCollection') diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php index 4171f4a6f80a3..f5b3c73d021e9 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/MassAddTest.php @@ -73,10 +73,9 @@ public function testExecuteWithException() $this->flag->expects($this->once())->method('lock') ->will($this->throwException(new \Exception('Test exception'))); - $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['critical']) - ->disableOriginalConstructor()->getMock(); + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $this->controllerArguments['context']->getObjectManager() - ->expects($this->at(2))->method('get')->with('Magento\Framework\Logger') + ->expects($this->at(2))->method('get')->with('Psr\Log\LoggerInterface') ->will($this->returnValue($logger)); $this->controller->execute(); diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php index df7ff93455d23..71c385ce8f154 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/RefreshTest.php @@ -67,10 +67,9 @@ public function testExecuteWithException() $this->flag->expects($this->once())->method('lock') ->will($this->throwException(new \Exception('Test exception'))); - $logger = $this->getMockBuilder('Magento\Framework\Logger')->setMethods(['critical']) - ->disableOriginalConstructor()->getMock(); + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $this->controllerArguments['context']->getObjectManager()->expects($this->at(1))->method('get') - ->with('Magento\Framework\Logger') + ->with('Psr\Log\LoggerInterface') ->will($this->returnValue($logger)); $this->controller->execute(); diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/MassOperationsTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/MassOperationsTest.php index 980020bf9d4b5..72752d10b7978 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/MassOperationsTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/MassOperationsTest.php @@ -30,7 +30,7 @@ class MassOperationsTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $storeManagerInterface; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $logger; /** @var \Magento\GoogleShopping\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */ @@ -49,7 +49,7 @@ protected function setUp() $this->productFactory = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $this->notificationInterface = $this->getMock('Magento\Framework\Notification\NotifierInterface'); $this->storeManagerInterface = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->googleShoppingHelper = $this->getMock('Magento\GoogleShopping\Helper\Data', [], [], '', false); $this->googleShoppingCategoryHelper = $this->getMock('Magento\GoogleShopping\Helper\Category'); diff --git a/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php b/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php index ad9392e906ed3..cd98cd9ee707d 100644 --- a/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php +++ b/dev/tests/unit/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php @@ -40,7 +40,7 @@ protected function setUp() $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $coreRegistry = $this->getMock('Magento\Framework\Registry', [], [], '', false); $this->product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $productFactoryMock = $this->getMock('Magento\Catalog\Model\ProductFactory', [], [], '', false); $this->catalogProductLink = $this->getMock( '\Magento\GroupedProduct\Model\Resource\Product\Link', diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php index 8b0f5e49a1f65..ce1d09e5366bb 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/ExportTest.php @@ -57,7 +57,7 @@ protected function _getMageImportExportModelExportMock() $this->returnValue($this->_exportFileExtension) ); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $entityFactory = $this->getMock( 'Magento\ImportExport\Model\Export\Entity\Factory', diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php index 15b1b6c5660d3..4b3e456e4675f 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php @@ -41,7 +41,7 @@ public function testIterate() $select = $this->getMock('Zend_Db_Select', [], [], '', false); $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); /** @var $collectionMock \Magento\Framework\Data\Collection\Db|PHPUnit_Framework_MockObject_MockObject */ $collectionMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index 41775ba819331..4e27d2ab84a86 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -190,9 +190,9 @@ protected function _createIntegrationController($actionName) $menuMock = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); - $loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); + $loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $loggerMock->expects($this->any())->method('critical')->will($this->returnSelf()); $menuMock->expects($this->any())->method('getParentItems')->will($this->returnValue([])); $blockMock->expects($this->any())->method('getMenuModel')->will($this->returnValue($menuMock)); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php index 45d3773694ee3..075e79d14d0d8 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Helper/Oauth/ConsumerTest.php @@ -33,7 +33,7 @@ class ConsumerTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Integration\Service\V1\OauthInterface */ protected $_oauthService; - /** @var \Magento\Framework\Logger */ + /** @var \Psr\Log\LoggerInterface */ protected $_loggerMock; protected function setUp() @@ -90,9 +90,7 @@ protected function setUp() 'Magento\Framework\HTTP\ZendClient' )->disableOriginalConstructor()->getMock(); $this->_loggerMock = $this->getMockBuilder( - 'Magento\Framework\Logger' - )->disableOriginalConstructor()->setMethods( - ['critical'] + 'Psr\Log\LoggerInterface' )->getMock(); $this->_oauthService = new \Magento\Integration\Service\V1\Oauth( diff --git a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php index 73aeef14728a5..b0a84bce0c522 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php @@ -43,7 +43,7 @@ protected function setUp() $this->getMock('Magento\Authorization\Model\Resource\Role\CollectionFactory', [], [], '', false), $this->getMock('Magento\Authorization\Model\RulesFactory', [], [], '', false), $this->getMock('Magento\Authorization\Model\Resource\Rules\CollectionFactory', [], [], '', false), - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMock('Magento\Framework\Acl\RootResource', [], [], '', false) ); } diff --git a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/OauthTest.php b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/OauthTest.php index eaeb90e7e172c..01ab337946ea3 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Service/V1/OauthTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Service/V1/OauthTest.php @@ -94,7 +94,7 @@ protected function setUp() $this->_tokenFactoryMock, $this->getMock('Magento\Integration\Helper\Oauth\Data', [], [], '', false), $this->getMock('Magento\Framework\HTTP\ZendClient', [], [], '', false), - $this->getMock('Magento\Framework\Logger', [], [], '', false), + $this->getMock('Psr\Log\LoggerInterface'), $this->getMock('Magento\Framework\Oauth\Helper\Oauth', [], [], '', false), $this->_tokenProviderMock ); diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php index 6c96fbfa42616..16d951af2fc30 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php @@ -18,7 +18,7 @@ protected function setUp() $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $adapterFactoryMock = $this->getMock( - 'Magento\Framework\Logger\AdapterFactory', + 'Psr\Log\LoggerInterface\AdapterFactory', ['create'], [], '', diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php index 651183471b28a..7cac02dbe88e1 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php @@ -18,7 +18,7 @@ protected function setUp() $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $adapterFactoryMock = $this->getMock( - 'Magento\Framework\Logger\AdapterFactory', + 'Psr\Log\LoggerInterface\AdapterFactory', ['create'], [], '', diff --git a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php index a9caa901e08a5..535adca0f1bcd 100644 --- a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php +++ b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php @@ -25,7 +25,7 @@ public function testTranslate() $config = $this->getMock('Magento\Ogone\Model\Config', [], [], '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $loggerFactory = $this->getMock('\Magento\Framework\Logger\AdapterFactory', [], [], '', false); + $loggerFactory = $this->getMock('\Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); $object = new \Magento\Ogone\Model\Api( $eventManager, $paymentDataMock, diff --git a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php index 0891b30fc9359..22fca248a05e5 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php @@ -22,7 +22,7 @@ public function testSetInfoTemplate() $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $paymentInfo = $objectManagerHelper->getObject('Magento\Payment\Model\Info'); $adapterFactoryMock = $this->getMock( - 'Magento\Framework\Logger\AdapterFactory', + 'Psr\Log\LoggerInterface\AdapterFactory', ['create'], [], '', diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php index e927fe780dac5..dd3d95bf9d5c4 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php @@ -20,7 +20,7 @@ protected function setUp() $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $paymentData = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); - $logAdapterFactory = $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false); + $logAdapterFactory = $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); $this->currencyPrice = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface')->getMock(); $this->methodFree = new \Magento\Payment\Model\Method\Free( diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php index e4234cca30092..2af8e61d612a2 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Controller/Ipn/IndexTest.php @@ -10,7 +10,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase /** @var Index */ protected $model; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $logger; /** @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -21,7 +21,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); $this->response = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php index 5c9b931611eb6..2c18495c669d8 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php @@ -15,7 +15,7 @@ class NvpTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Customer\Helper\Address|\PHPUnit_Framework_MockObject_MockObject */ protected $customerAddressHelper; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $logger; /** @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -45,10 +45,10 @@ class NvpTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->customerAddressHelper = $this->getMock('Magento\Customer\Helper\Address', [], [], '', false); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->resolver = $this->getMock('Magento\Framework\Locale\ResolverInterface'); $this->regionFactory = $this->getMock('Magento\Directory\Model\RegionFactory', [], [], '', false); - $this->adapterFactory = $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false); + $this->adapterFactory = $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); $this->countryFactory = $this->getMock('Magento\Directory\Model\CountryFactory', [], [], '', false); $processableExceptionFactory = $this->getMock( 'Magento\Paypal\Model\Api\ProcessableExceptionFactory', diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php index 1c13879a5a15e..6a8c89d399744 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php @@ -101,7 +101,7 @@ protected function setUp() $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', [ 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false), + 'logAdapterFactory' => $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false), 'curlFactory' => $this->curlFactory, 'orderFactory' => $this->_orderMock, 'paypalInfo' => $this->_paypalInfo, @@ -180,7 +180,7 @@ public function testPaymentReviewRegisterPaymentFraud() $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', [ 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Magento\Framework\Logger\AdapterFactory', [], [], '', false), + 'logAdapterFactory' => $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false), 'curlFactory' => $this->curlFactory, 'orderFactory' => $this->_orderMock, 'paypalInfo' => $this->_paypalInfo, diff --git a/dev/tests/unit/testsuite/Magento/Reports/Model/Resource/Report/Collection/AbstractCollectionTest.php b/dev/tests/unit/testsuite/Magento/Reports/Model/Resource/Report/Collection/AbstractCollectionTest.php index f8bfd4a06e5a6..69d555efe558d 100644 --- a/dev/tests/unit/testsuite/Magento/Reports/Model/Resource/Report/Collection/AbstractCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Reports/Model/Resource/Report/Collection/AbstractCollectionTest.php @@ -14,7 +14,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $entityFactory = $this->getMock('\Magento\Core\Model\EntityFactory', [], [], '', false); - $logger = $this->getMock('\Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('\Psr\Log\LoggerInterface', [], [], '', false); $fetchStrategy = $this->getMock('\Magento\Framework\Data\Collection\Db\FetchStrategy\Query', [], [], '', false); $eventManager = $this->getMock('\Magento\Framework\Event\Manager', [], [], '', false); $connection = $this->getMock('\Magento\Framework\DB\Adapter\Pdo\Mysql', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php index 57e071b3ce953..2fc0f29b85572 100644 --- a/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Review/Model/Resource/Review/Summary/CollectionTest.php @@ -23,7 +23,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase protected $entityFactoryMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $loggerMock; @@ -58,7 +58,7 @@ protected function setUp() '', false ); - $this->loggerMock = $this->getMock('Magento\Framework\Logger', ['log'], [], '', false); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->resourceMock = $this->getMock( 'Magento\Framework\App\Resource', [], diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php index 25921b6990c2e..109f79c4b2298 100644 --- a/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Condition/CombineTest.php @@ -20,7 +20,7 @@ class CombineTest extends \PHPUnit_Framework_TestCase private $conditionFactoryMock; /** - * @var \Magento\Framework\Logger | \PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface | \PHPUnit_Framework_MockObject_MockObject */ private $loggerMock; @@ -40,7 +40,7 @@ protected function setUp() ->setMethods([]) ->getMock(); - $this->loggerMock = $this->getMockBuilder('\Magento\Framework\Logger') + $this->loggerMock = $this->getMockBuilder('\Psr\Log\LoggerInterface') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Rule/Model/Resource/Rule/Collection/AbstractCollectionTest.php b/dev/tests/unit/testsuite/Magento/Rule/Model/Resource/Rule/Collection/AbstractCollectionTest.php index f6aafa74b4ea4..5b0448f6cc933 100644 --- a/dev/tests/unit/testsuite/Magento/Rule/Model/Resource/Rule/Collection/AbstractCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Rule/Model/Resource/Rule/Collection/AbstractCollectionTest.php @@ -25,7 +25,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected $_entityFactoryMock; /** - * @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $_loggerMock; @@ -47,7 +47,7 @@ class AbstractCollectionTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_entityFactoryMock = $this->getMock('Magento\Framework\Data\Collection\EntityFactoryInterface'); - $this->_loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->_loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->_fetchStrategyMock = $this->getMock('Magento\Framework\Data\Collection\Db\FetchStrategyInterface'); $this->_managerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); $this->_db = $this->getMockForAbstractClass( diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php index 4594b959c67b0..80a1d4554f535 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php @@ -83,7 +83,7 @@ protected function setUp() $registryMock = $this->getMock('Magento\Framework\Registry'); $configMock = $this->getMock('Magento\Sales\Model\Config', [], [], '', false); $this->sessionQuoteMock = $this->getMock('Magento\Backend\Model\Session\Quote', [], [], '', false); - $loggerMock = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $copyMock = $this->getMock('Magento\Framework\Object\Copy', [], [], '', false); $messageManagerMock = $this->getMock('Magento\Framework\Message\ManagerInterface'); $this->formFactoryMock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php index 4091a20ee0f4a..36eb38f6789a8 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/AdminOrder/EmailSenderTest.php @@ -41,7 +41,7 @@ protected function setUp() false ); $this->loggerMock = $this->getMock( - '\Magento\Framework\Logger', + '\Psr\Log\LoggerInterface', [], [], '', diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php index 5be56a6b12ae1..02507357841a1 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoNotifierTest.php @@ -61,13 +61,7 @@ public function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical'], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->notifier = new CreditmemoNotifier( $this->historyCollectionFactory, $this->loggerMock, diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php index 416f702e22b0e..0c1e956462581 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceNotifierTest.php @@ -61,13 +61,7 @@ public function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical'], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->notifier = new InvoiceNotifier( $this->historyCollectionFactory, $this->loggerMock, diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php index 9328efcab2f8c..2f75543c3981b 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Total/Config/BaseTest.php @@ -14,7 +14,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Framework\App\Cache\Type\Config|\PHPUnit_Framework_MockObject_MockObject */ protected $configCacheType; - /** @var \Magento\Framework\Logger|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $logger; /** @var \Magento\Sales\Model\Config|\PHPUnit_Framework_MockObject_MockObject */ @@ -26,7 +26,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->configCacheType = $this->getMock('Magento\Framework\App\Cache\Type\Config', [], [], '', false); - $this->logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->salesConfig = $this->getMock('Magento\Sales\Model\Config', [], [], '', false); $this->orderTotalFactory = $this->getMock('Magento\Sales\Model\Order\TotalFactory', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php index 2478cd0a11ff6..b9e83c9149459 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderNotifierTest.php @@ -61,13 +61,7 @@ public function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical'], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->notifier = new OrderNotifier( $this->historyCollectionFactory, $this->loggerMock, diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/History/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/History/CollectionTest.php index 7d76ae4ca3bec..27daafea1a971 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/History/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/History/CollectionTest.php @@ -97,7 +97,7 @@ public function setUp() ->method('create') ->will($this->returnValue($this->historyItemMock)); - $logger = $this->getMock('Magento\Framework\Logger', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $this->collection = new \Magento\Sales\Model\Resource\Order\Status\History\Collection( $this->entityFactoryMock, $logger, diff --git a/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/CollectionTest.php b/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/CollectionTest.php index bd0aa76837deb..25e0312732b58 100644 --- a/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/SalesRule/Model/Resource/Report/CollectionTest.php @@ -61,13 +61,7 @@ protected function setUp() false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - [], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->fetchStrategy = $this->getMock( 'Magento\Framework\Data\Collection\Db\FetchStrategyInterface', diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php index 42b71d2689ccd..3f95683d565f3 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/CreateLabelTest.php @@ -199,13 +199,7 @@ public function testExecuteLoadException() */ public function testExecuteSaveException() { - $logerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical', '__wakeup'], - [], - '', - false - ); + $logerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->shipmentLoaderMock->expects($this->once()) ->method('load') @@ -218,7 +212,7 @@ public function testExecuteSaveException() $logerMock->expects($this->once())->method('critical'); $this->objectManagerMock->expects($this->once()) ->method('get') - ->with('Magento\Framework\Logger') + ->with('Psr\Log\LoggerInterface') ->will($this->returnValue($logerMock)); $this->responseMock->expects($this->once())->method('representJson'); diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php index 866d56eafe8d8..4417442079732 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/PrintLabelTest.php @@ -301,13 +301,7 @@ public function testExecuteImageStringFail() $labelContent = 'Label-content'; $incrementId = '1000001'; - $loggerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical'], - [], - '', - false - ); + $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->shipmentLoaderMock->expects($this->once()) ->method('load') @@ -332,7 +326,7 @@ public function testExecuteImageStringFail() ->will($this->returnSelf()); $this->objectManagerMock->expects($this->once()) ->method('get') - ->with('Magento\Framework\Logger') + ->with('Psr\Log\LoggerInterface') ->will($this->returnValue($loggerMock)); $loggerMock->expects($this->once()) ->method('critical'); diff --git a/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php b/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php index 70b25e843215c..647d012cb2e42 100644 --- a/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php +++ b/dev/tests/unit/testsuite/Magento/Shipping/Model/ShipmentNotifierTest.php @@ -61,13 +61,7 @@ public function setUp() '', false ); - $this->loggerMock = $this->getMock( - 'Magento\Framework\Logger', - ['critical'], - [], - '', - false - ); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); $this->notifier = new ShipmentNotifier( $this->historyCollectionFactory, $this->loggerMock, diff --git a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Theme/IndexTest.php b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Theme/IndexTest.php index 22b22e760544a..bc70b77601ccc 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Theme/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Theme/IndexTest.php @@ -17,7 +17,7 @@ public function testIndexAction() $menuModel = $this->getMock( 'Magento\Backend\Model\Menu', [], - [$this->getMock('Magento\Framework\Logger', [], [], '', false)] + [$this->getMock('Psr\Log\LoggerInterface')] ); $menuModel->expects($this->once()) ->method('getParentItems') diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php index 0fe8d442a1c61..58cd77c941e18 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Controller/ErrorProcessorTest.php @@ -21,7 +21,7 @@ class ErrorProcessorTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $_appStateMock; - /** @var \Magento\Framework\Logger */ + /** @var \Psr\Log\LoggerInterface */ protected $_loggerMock; protected function setUp() @@ -35,7 +35,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->_loggerMock = $this->getMockBuilder('Magento\Framework\Logger')->disableOriginalConstructor()->getMock(); + $this->_loggerMock = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $filesystemMock = $this->getMockBuilder('\Magento\Framework\Filesystem') ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/App/Area.php b/lib/internal/Magento/Framework/App/Area.php index 07f24f415f3ee..0cef58d915916 100644 --- a/lib/internal/Magento/Framework/App/Area.php +++ b/lib/internal/Magento/Framework/App/Area.php @@ -62,7 +62,7 @@ class Area implements \Magento\Framework\App\AreaInterface protected $_diConfigLoader; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -84,7 +84,7 @@ class Area implements \Magento\Framework\App\AreaInterface protected $_designExceptions; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\TranslateInterface $translator * @param \Magento\Framework\ObjectManagerInterface $objectManager @@ -95,7 +95,7 @@ class Area implements \Magento\Framework\App\AreaInterface * @param string $areaCode */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\TranslateInterface $translator, \Magento\Framework\ObjectManagerInterface $objectManager, diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 07666344ff87d..c3808f5764af6 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -410,7 +410,7 @@ protected function terminate(\Exception $e) if (!$this->objectManager) { throw new \DomainException(); } - $this->objectManager->get('Magento\Framework\Logger')->critical($e); + $this->objectManager->get('Psr\Log\LoggerInterface')->critical($e); } catch (\Exception $e) { $message .= "Could not write error message to log. Please use developer mode to see the message.\n"; } diff --git a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php index 9eace9044d167..175cb85b531fe 100644 --- a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php +++ b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php @@ -36,7 +36,7 @@ abstract class AbstractHelper protected $_moduleManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/lib/internal/Magento/Framework/App/Helper/Context.php b/lib/internal/Magento/Framework/App/Helper/Context.php index 48cebe198961b..49ae5dd5be2c8 100644 --- a/lib/internal/Magento/Framework/App/Helper/Context.php +++ b/lib/internal/Magento/Framework/App/Helper/Context.php @@ -24,7 +24,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface protected $_eventManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -66,7 +66,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface /** * @param \Magento\Framework\Url\EncoderInterface $urlEncoder * @param \Magento\Framework\Url\DecoderInterface $urlDecoder - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Translate\InlineInterface $translateInline * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Framework\App\RequestInterface $httpRequest @@ -81,7 +81,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface public function __construct( \Magento\Framework\Url\EncoderInterface $urlEncoder, \Magento\Framework\Url\DecoderInterface $urlDecoder, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Translate\InlineInterface $translateInline, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\App\RequestInterface $httpRequest, @@ -153,7 +153,7 @@ public function getEventManager() } /** - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/DB/AbstractMapper.php b/lib/internal/Magento/Framework/DB/AbstractMapper.php index d6cac55a45e27..cde379716e23f 100644 --- a/lib/internal/Magento/Framework/DB/AbstractMapper.php +++ b/lib/internal/Magento/Framework/DB/AbstractMapper.php @@ -8,7 +8,7 @@ use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\Data\ObjectFactory; use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Object; /** diff --git a/lib/internal/Magento/Framework/DB/Query.php b/lib/internal/Magento/Framework/DB/Query.php index 39ef80941e14d..15e6575326c2a 100644 --- a/lib/internal/Magento/Framework/DB/Query.php +++ b/lib/internal/Magento/Framework/DB/Query.php @@ -4,7 +4,7 @@ */ namespace Magento\Framework\DB; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Class Query diff --git a/lib/internal/Magento/Framework/Data/AbstractSearchCriteriaBuilder.php b/lib/internal/Magento/Framework/Data/AbstractSearchCriteriaBuilder.php index c7571d72e8957..6845e5edd8fd4 100644 --- a/lib/internal/Magento/Framework/Data/AbstractSearchCriteriaBuilder.php +++ b/lib/internal/Magento/Framework/Data/AbstractSearchCriteriaBuilder.php @@ -4,7 +4,7 @@ */ namespace Magento\Framework\Data; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Class AbstractSearchCriteriaBuilder diff --git a/lib/internal/Magento/Framework/Data/Collection/Db.php b/lib/internal/Magento/Framework/Data/Collection/Db.php index 5694e470cf06a..a3d0b641186d6 100644 --- a/lib/internal/Magento/Framework/Data/Collection/Db.php +++ b/lib/internal/Magento/Framework/Data/Collection/Db.php @@ -7,7 +7,7 @@ use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Base items collection class diff --git a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php index 29883baa622f4..c6baaa318678a 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php +++ b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php @@ -153,7 +153,7 @@ abstract class AbstractAdapter implements AdapterInterface protected $directoryWrite; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; diff --git a/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php b/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php index 1096ec6a7f72d..331ce1d74e15d 100644 --- a/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php +++ b/lib/internal/Magento/Framework/Less/PreProcessor/ErrorHandler.php @@ -10,14 +10,14 @@ class ErrorHandler implements ErrorHandlerInterface { /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ - public function __construct(\Magento\Framework\Logger $logger) + public function __construct(\Psr\Log\LoggerInterface $logger) { $this->logger = $logger; } diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 4ea6187585b94..e1bac02e7f0fa 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -5,7 +5,7 @@ namespace Magento\Framework\Message; use Magento\Framework\Event\ManagerInterface as EventManagerInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; /** * Message manager model diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 9bf7cd8b94129..b223b53f1ce17 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -109,7 +109,7 @@ abstract class AbstractModel extends \Magento\Framework\Object protected $_registry; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/lib/internal/Magento/Framework/Model/Context.php b/lib/internal/Magento/Framework/Model/Context.php index 2b2835b5a20ed..78f7125d25487 100644 --- a/lib/internal/Magento/Framework/Model/Context.php +++ b/lib/internal/Magento/Framework/Model/Context.php @@ -19,7 +19,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface protected $_cacheManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -34,14 +34,14 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface protected $_actionValidator; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Event\ManagerInterface $eventDispatcher * @param \Magento\Framework\App\CacheInterface $cacheManager * @param \Magento\Framework\App\State $appState * @param \Magento\Framework\Model\ActionValidator\RemoveAction $actionValidator */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Event\ManagerInterface $eventDispatcher, \Magento\Framework\App\CacheInterface $cacheManager, \Magento\Framework\App\State $appState, @@ -71,7 +71,7 @@ public function getEventDispatcher() } /** - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php index aead4c8901f03..6e68ed3552d56 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php @@ -95,7 +95,7 @@ abstract class AbstractCollection extends \Magento\Framework\Data\Collection\Db /** * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Zend_Db_Adapter_Abstract $connection @@ -103,7 +103,7 @@ abstract class AbstractCollection extends \Magento\Framework\Data\Collection\Db */ public function __construct( \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Framework\Event\ManagerInterface $eventManager, $connection = null, diff --git a/lib/internal/Magento/Framework/Module/DataSetup.php b/lib/internal/Magento/Framework/Module/DataSetup.php index ab81a99648731..7612e372fa0a7 100644 --- a/lib/internal/Magento/Framework/Module/DataSetup.php +++ b/lib/internal/Magento/Framework/Module/DataSetup.php @@ -50,7 +50,7 @@ class DataSetup extends \Magento\Framework\Module\Setup implements \Magento\Fram protected $_eventManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/lib/internal/Magento/Framework/Module/Setup/Context.php b/lib/internal/Magento/Framework/Module/Setup/Context.php index 5eb9006f3633c..a2fcecf9f14f9 100644 --- a/lib/internal/Magento/Framework/Module/Setup/Context.php +++ b/lib/internal/Magento/Framework/Module/Setup/Context.php @@ -7,7 +7,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -54,7 +54,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface /** * Constructor * - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\App\Resource $appResource * @param \Magento\Framework\Module\Dir\Reader $modulesReader @@ -65,7 +65,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\App\Resource $appResource, \Magento\Framework\Module\Dir\Reader $modulesReader, @@ -95,7 +95,7 @@ public function getEventManager() } /** - * @return \Magento\Framework\Logger $logger + * @return \Psr\Log\LoggerInterface $logger */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/View/Asset/Merged.php b/lib/internal/Magento/Framework/View/Asset/Merged.php index 4da09f0e3d23b..9bb0d8f409752 100644 --- a/lib/internal/Magento/Framework/View/Asset/Merged.php +++ b/lib/internal/Magento/Framework/View/Asset/Merged.php @@ -10,7 +10,7 @@ class Merged implements \Iterator { /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -40,14 +40,14 @@ class Merged implements \Iterator protected $isInitialized = false; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param MergeStrategyInterface $mergeStrategy * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param MergeableInterface[] $assets * @throws \InvalidArgumentException */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, MergeStrategyInterface $mergeStrategy, \Magento\Framework\View\Asset\Repository $assetRepo, array $assets diff --git a/lib/internal/Magento/Framework/View/Asset/Minified.php b/lib/internal/Magento/Framework/View/Asset/Minified.php index 6ad6c6f151d91..17e5230e458bf 100644 --- a/lib/internal/Magento/Framework/View/Asset/Minified.php +++ b/lib/internal/Magento/Framework/View/Asset/Minified.php @@ -74,7 +74,7 @@ class Minified implements MergeableInterface /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -103,7 +103,7 @@ class Minified implements MergeableInterface * Constructor * * @param LocalInterface $asset - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Framework\UrlInterface $baseUrl * @param \Magento\Framework\Code\Minifier\AdapterInterface $adapter @@ -111,7 +111,7 @@ class Minified implements MergeableInterface */ public function __construct( LocalInterface $asset, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\UrlInterface $baseUrl, \Magento\Framework\Code\Minifier\AdapterInterface $adapter, diff --git a/lib/internal/Magento/Framework/View/Context.php b/lib/internal/Magento/Framework/View/Context.php index 2c3f945255452..df294c469070e 100644 --- a/lib/internal/Magento/Framework/View/Context.php +++ b/lib/internal/Magento/Framework/View/Context.php @@ -11,7 +11,7 @@ use Magento\Framework\App\Request\Http as Request; use Magento\Framework\App\State as AppState; use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\Logger; +use Psr\Log\LoggerInterface as Logger; use Magento\Framework\Session\SessionManager; use Magento\Framework\TranslateInterface; use Magento\Framework\UrlInterface; @@ -114,7 +114,7 @@ class Context /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -302,7 +302,7 @@ public function getCacheState() /** * Retrieve logger * - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Image.php b/lib/internal/Magento/Framework/View/Design/Theme/Image.php index 4dcad824f2fc0..5408f611b83a2 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/Image.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/Image.php @@ -63,7 +63,7 @@ class Image /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -88,7 +88,7 @@ class Image * @param \Magento\Framework\Image\Factory $imageFactory * @param Image\Uploader $uploader * @param Image\PathInterface $themeImagePath - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param array $imageParams * @param ThemeInterface $theme * @codingStandardsIgnoreStart @@ -98,7 +98,7 @@ public function __construct( \Magento\Framework\Image\Factory $imageFactory, Image\Uploader $uploader, Image\PathInterface $themeImagePath, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, array $imageParams = [self::PREVIEW_IMAGE_WIDTH, self::PREVIEW_IMAGE_HEIGHT], ThemeInterface $theme = null ) { diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 77eaa40ec95f9..56689fe7335ae 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -117,7 +117,7 @@ abstract class AbstractBlock extends \Magento\Framework\Object implements BlockI /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; diff --git a/lib/internal/Magento/Framework/View/Element/Context.php b/lib/internal/Magento/Framework/View/Element/Context.php index c908ec9fe3204..c51fb19a835b2 100644 --- a/lib/internal/Magento/Framework/View/Element/Context.php +++ b/lib/internal/Magento/Framework/View/Element/Context.php @@ -107,7 +107,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface /** * Logger * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -149,7 +149,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -171,7 +171,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -340,7 +340,7 @@ public function getCacheState() /** * Get logger * - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/View/Element/Template/Context.php b/lib/internal/Magento/Framework/View/Element/Template/Context.php index e0578a46ec545..1045d69095fc9 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/Context.php +++ b/lib/internal/Magento/Framework/View/Element/Template/Context.php @@ -16,7 +16,7 @@ class Context extends \Magento\Framework\View\Element\Context /** * Logger instance * - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $_logger; @@ -74,7 +74,7 @@ class Context extends \Magento\Framework\View\Element\Context * @param \Magento\Framework\View\Asset\Repository $assetRepo * @param \Magento\Framework\View\ConfigInterface $viewConfig * @param \Magento\Framework\App\Cache\StateInterface $cacheState - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Filter\FilterManager $filterManager * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -102,7 +102,7 @@ public function __construct( \Magento\Framework\View\Asset\Repository $assetRepo, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Escaper $escaper, \Magento\Framework\Filter\FilterManager $filterManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -157,7 +157,7 @@ public function getFilesystem() /** * Get logger instance * - * @return \Magento\Framework\Logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php index 641c7ea54374d..cff15d3f74a96 100644 --- a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php +++ b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php @@ -19,18 +19,18 @@ class Structure extends DataStructure protected $_nameIncrement = []; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; /** * Constructor * - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger * @param array $elements */ public function __construct( - \Magento\Framework\Logger $logger, + \Psr\Log\LoggerInterface $logger, array $elements = null ) { $this->logger = $logger; diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index 15e7e4b26031e..1fb604e81f1f4 100644 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -29,7 +29,7 @@ class Block implements Layout\GeneratorInterface protected $eventManager; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -39,13 +39,13 @@ class Block implements Layout\GeneratorInterface * @param \Magento\Framework\View\Element\BlockFactory $blockFactory * @param \Magento\Framework\Data\Argument\InterpreterInterface $argumentInterpreter * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( \Magento\Framework\View\Element\BlockFactory $blockFactory, \Magento\Framework\Data\Argument\InterpreterInterface $argumentInterpreter, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->blockFactory = $blockFactory; $this->argumentInterpreter = $argumentInterpreter; diff --git a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php index 0e5a9253b398e..0c919eb96ea43 100644 --- a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php +++ b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php @@ -26,15 +26,15 @@ class Helper protected $counter = 0; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; /** - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->logger = $logger; } diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index 9bec2a0bd36a4..5edeba40ea2db 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -39,7 +39,7 @@ class Renderer protected $string; /** - * @var \Magento\Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; @@ -55,7 +55,7 @@ class Renderer * @param \Magento\Framework\UrlInterface $urlBuilder * @param \Magento\Framework\Escaper $escaper * @param \Magento\Framework\Stdlib\String $string - * @param \Magento\Framework\Logger $logger + * @param \Psr\Log\LoggerInterface $logger */ public function __construct( Config $pageConfig, @@ -64,7 +64,7 @@ public function __construct( \Magento\Framework\UrlInterface $urlBuilder, \Magento\Framework\Escaper $escaper, \Magento\Framework\Stdlib\String $string, - \Magento\Framework\Logger $logger + \Psr\Log\LoggerInterface $logger ) { $this->pageConfig = $pageConfig; $this->assetMinifyService = $assetMinifyService; From 737f9c13e19b563724662ab22fd3cee4e13ab607 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 14:29:41 +0200 Subject: [PATCH 07/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - configure logger --- app/etc/di.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/etc/di.xml b/app/etc/di.xml index 048eea823d789..09307c527d582 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -5,6 +5,7 @@ */ --> + @@ -84,6 +85,32 @@ + + + var/log/system.log + Monolog\Logger::DEBUG + + + + + var/log/exception.log + Monolog\Logger::CRITICAL + + + + + main + + Monolog\Heandler\Stream\Exception + Monolog\Heandler\Stream\System + + + + + + var/log/system.log + + Magento\Framework\Model\ActionValidator\RemoveAction\Proxy From f0fd0a8399a19fae75d959c5059f5bd0850f8706 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 14:55:22 +0200 Subject: [PATCH 08/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - eliminate Magento\Framework\Logger --- .../Test/Legacy/_files/obsolete_classes.php | 1 + lib/internal/Magento/Framework/Logger.php | 54 ------------------- .../Magento/Framework/View/Result/Page.php | 2 +- 3 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 lib/internal/Magento/Framework/Logger.php diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index b80740de2d0f2..764fc631b7934 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -2829,4 +2829,5 @@ ['Magento\Rule\Model\Rule', 'Magento\Rule\Model\AbstractModel'], ['Magento\Framework\App\Cache\State\Options', 'Magento\Framework\App\Cache\State'], ['Magento\Framework\App\Cache\State\OptionsInterface', 'Magento\Framework\App\Cache\State'], + ['Magento\Framework\Logger', 'Psr\Log\LoggerInterface'], ]; diff --git a/lib/internal/Magento/Framework/Logger.php b/lib/internal/Magento/Framework/Logger.php deleted file mode 100644 index bc9b11ab1a566..0000000000000 --- a/lib/internal/Magento/Framework/Logger.php +++ /dev/null @@ -1,54 +0,0 @@ -log($message, $level); - } - - /** - * Log a message with "debug" level - * - * @param string $message - * @return void - */ - public function debug($message) - { - $this->info($message); - } - - /** - * Log an exception - * - * @param \Exception $e - * @return void - */ - public function critical(\Exception $e) - { - $this->info("\n" . $e->__toString()); - } -} diff --git a/lib/internal/Magento/Framework/View/Result/Page.php b/lib/internal/Magento/Framework/View/Result/Page.php index e45eee4157ffc..4ddaf6f914401 100644 --- a/lib/internal/Magento/Framework/View/Result/Page.php +++ b/lib/internal/Magento/Framework/View/Result/Page.php @@ -78,7 +78,7 @@ class Page extends Layout protected $assetRepo; /** - * @var Framework\Logger + * @var \Psr\Log\LoggerInterface */ protected $logger; From bfa23651061ea6e11935bbae99ebb3a136fce3c2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi Date: Fri, 19 Dec 2014 16:15:55 +0200 Subject: [PATCH 09/24] MAGETWO-31961: Exception when add configurable product from wishlist into cart(problem with product id and item_id) --- .../Wishlist/Controller/Index/Cart.php | 113 ++- .../Wishlist/Controller/Index/CartTest.php | 797 ++++++++++++++++++ 2 files changed, 867 insertions(+), 43 deletions(-) create mode 100644 dev/tests/unit/testsuite/Magento/Wishlist/Controller/Index/CartTest.php diff --git a/app/code/Magento/Wishlist/Controller/Index/Cart.php b/app/code/Magento/Wishlist/Controller/Index/Cart.php index 27e2885c75377..edb018b57b84e 100644 --- a/app/code/Magento/Wishlist/Controller/Index/Cart.php +++ b/app/code/Magento/Wishlist/Controller/Index/Cart.php @@ -21,18 +21,66 @@ class Cart extends Action\Action implements IndexInterface */ protected $quantityProcessor; + /** + * @var \Magento\Wishlist\Model\ItemFactory + */ + protected $itemFactory; + + /** + * @var \Magento\Checkout\Model\Cart + */ + protected $cart; + + /** + * @var \Magento\Wishlist\Model\Item\OptionFactory + */ + private $optionFactory; + + /** + * @var \Magento\Catalog\Helper\Product + */ + protected $productHelper; + + /** + * @var \Magento\Framework\Escaper + */ + protected $escaper; + + /** + * @var \Magento\Wishlist\Helper\Data + */ + protected $helper; + /** * @param Action\Context $context * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider * @param \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor + * @param \Magento\Wishlist\Model\ItemFactory $itemFactory + * @param \Magento\Checkout\Model\Cart $cart + * @param \Magento\Wishlist\Model\Item\OptionFactory $ + * @param \Magento\Catalog\Helper\Product $productHelper + * @param \Magento\Framework\Escaper $escaper + * @param \Magento\Wishlist\Helper\Data $helper */ public function __construct( Action\Context $context, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, - \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor + \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor, + \Magento\Wishlist\Model\ItemFactory $itemFactory, + \Magento\Checkout\Model\Cart $cart, + \Magento\Wishlist\Model\Item\OptionFactory $optionFactory, + \Magento\Catalog\Helper\Product $productHelper, + \Magento\Framework\Escaper $escaper, + \Magento\Wishlist\Helper\Data $helper ) { $this->wishlistProvider = $wishlistProvider; $this->quantityProcessor = $quantityProcessor; + $this->itemFactory = $itemFactory; + $this->cart = $cart; + $this->optionFactory = $optionFactory; + $this->productHelper = $productHelper; + $this->escaper = $escaper; + $this->helper = $helper; parent::__construct($context); } @@ -49,7 +97,7 @@ public function execute() $itemId = (int)$this->getRequest()->getParam('item'); /* @var $item \Magento\Wishlist\Model\Item */ - $item = $this->_objectManager->create('Magento\Wishlist\Model\Item')->load($itemId); + $item = $this->itemFactory->create()->load($itemId); if (!$item->getId()) { return $this->_redirect('*/*'); } @@ -72,82 +120,61 @@ public function execute() $item->setQty($qty); } - /* @var $session \Magento\Framework\Session\Generic */ - $session = $this->_objectManager->get('Magento\Wishlist\Model\Session'); - $cart = $this->_objectManager->get('Magento\Checkout\Model\Cart'); - $redirectUrl = $this->_url->getUrl('*/*'); + $configureUrl = $this->_url->getUrl( + '*/*/configure/', + [ + 'id' => $item->getId(), + 'product_id' => $item->getProductId(), + ] + ); try { - $options = $this->_objectManager->create( - 'Magento\Wishlist\Model\Item\Option' - )->getCollection()->addItemFilter( - [$itemId] - ); + /** @var \Magento\Wishlist\Model\Resource\Item\Option\Collection $options */ + $options = $this->optionFactory->create()->getCollection()->addItemFilter([$itemId]); $item->setOptions($options->getOptionsByItem($itemId)); - $buyRequest = $this->_objectManager->get( - 'Magento\Catalog\Helper\Product' - )->addParamsToBuyRequest( + $buyRequest = $this->productHelper->addParamsToBuyRequest( $this->getRequest()->getParams(), ['current_config' => $item->getBuyRequest()] ); $item->mergeBuyRequest($buyRequest); - $item->addToCart($cart, true); - $cart->save()->getQuote()->collectTotals(); + $item->addToCart($this->cart, true); + $this->cart->save()->getQuote()->collectTotals(); $wishlist->save(); - if (!$cart->getQuote()->getHasError()) { + if (!$this->cart->getQuote()->getHasError()) { $message = __( 'You added %1 to your shopping cart.', - $this->_objectManager->get('Magento\Framework\Escaper')->escapeHtml($item->getProduct()->getName()) + $this->escaper->escapeHtml($item->getProduct()->getName()) ); $this->messageManager->addSuccess($message); } - $this->_objectManager->get('Magento\Wishlist\Helper\Data')->calculate(); - - if ($this->_objectManager->get('Magento\Checkout\Helper\Cart')->getShouldRedirectToCart()) { - $redirectUrl = $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl(); + if ($this->cart->getShouldRedirectToCart()) { + $redirectUrl = $this->cart->getCartUrl(); } else { $refererUrl = $this->_redirect->getRefererUrl(); - if ($refererUrl && - ($refererUrl != $this->_objectManager->get('Magento\Framework\UrlInterface') - ->getUrl('*/*/configure/', ['id' => $item->getId(), 'product_id' => $item->getProductId()]) - ) - ) { + if ($refererUrl && $refererUrl != $configureUrl) { $redirectUrl = $refererUrl; } } - $this->_objectManager->get('Magento\Wishlist\Helper\Data')->calculate(); } catch (\Magento\Framework\Model\Exception $e) { if ($e->getCode() == \Magento\Wishlist\Model\Item::EXCEPTION_CODE_NOT_SALABLE) { $this->messageManager->addError(__('This product(s) is out of stock.')); } elseif ($e->getCode() == \Magento\Wishlist\Model\Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) { $this->messageManager->addNotice($e->getMessage()); - $redirectUrl = $this->_url->getUrl( - '*/*/configure/', - [ - 'id' => $item->getId(), - 'product_id' => $item->getProductId(), - ] - ); + $redirectUrl = $configureUrl; } else { $this->messageManager->addNotice($e->getMessage()); - $redirectUrl = $this->_url->getUrl( - '*/*/configure/', - [ - 'id' => $item->getId(), - 'product_id' => $item->getProductId(), - ] - ); + $redirectUrl = $configureUrl; } } catch (\Exception $e) { $this->messageManager->addException($e, __('Cannot add item to shopping cart')); } - $this->_objectManager->get('Magento\Wishlist\Helper\Data')->calculate(); + $this->helper->calculate(); return $this->getResponse()->setRedirect($redirectUrl); } diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Controller/Index/CartTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Controller/Index/CartTest.php new file mode 100644 index 0000000000000..9fdcf260c8079 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Controller/Index/CartTest.php @@ -0,0 +1,797 @@ +wishlistProviderMock = $this->getMockBuilder('Magento\Wishlist\Controller\WishlistProviderInterface') + ->disableOriginalConstructor() + ->setMethods(['getWishlist']) + ->getMockForAbstractClass(); + + $this->quantityProcessorMock = $this->getMockBuilder('Magento\Wishlist\Model\LocaleQuantityProcessor') + ->disableOriginalConstructor() + ->getMock(); + + $this->itemFactoryMock = $this->getMockBuilder('Magento\Wishlist\Model\ItemFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->checkoutCartMock = $this->getMockBuilder('Magento\Checkout\Model\Cart') + ->disableOriginalConstructor() + ->setMethods(['save', 'getQuote', 'getShouldRedirectToCart', 'getCartUrl']) + ->getMock(); + + $this->optionFactoryMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\OptionFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->productHelperMock = $this->getMockBuilder('Magento\Catalog\Helper\Product') + ->disableOriginalConstructor() + ->getMock(); + + $this->escaperMock = $this->getMockBuilder('Magento\Framework\Escaper') + ->disableOriginalConstructor() + ->getMock(); + + $this->helperMock = $this->getMockBuilder('Magento\Wishlist\Helper\Data') + ->disableOriginalConstructor() + ->getMock(); + + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods(['getParams', 'getParam']) + ->getMockForAbstractClass(); + + $this->responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods(['setRedirect']) + ->getMockForAbstractClass(); + + $this->redirectMock = $this->getMockBuilder('Magento\Framework\App\Response\RedirectInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->messageManagerMock = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface') + ->disableOriginalConstructor() + ->setMethods(['addSuccess']) + ->getMockForAbstractClass(); + + $this->urlMock = $this->getMockBuilder('Magento\Framework\UrlInterface') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMockForAbstractClass(); + + $this->contextMock = $this->getMockBuilder('Magento\Framework\App\Action\Context') + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->will($this->returnValue($this->requestMock)); + $this->contextMock->expects($this->any()) + ->method('getResponse') + ->will($this->returnValue($this->responseMock)); + $this->contextMock->expects($this->any()) + ->method('getRedirect') + ->will($this->returnValue($this->redirectMock)); + $this->contextMock->expects($this->any()) + ->method('getObjectManager') + ->will($this->returnValue($this->objectManagerMock)); + $this->contextMock->expects($this->any()) + ->method('getMessageManager') + ->will($this->returnValue($this->messageManagerMock)); + $this->contextMock->expects($this->any()) + ->method('getUrl') + ->will($this->returnValue($this->urlMock)); + + $this->model = new Cart( + $this->contextMock, + $this->wishlistProviderMock, + $this->quantityProcessorMock, + $this->itemFactoryMock, + $this->checkoutCartMock, + $this->optionFactoryMock, + $this->productHelperMock, + $this->escaperMock, + $this->helperMock + ); + } + + public function testExecuteWithNoItem() + { + $itemId = false; + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + + $this->requestMock->expects($this->once()) + ->method('getParam') + ->with('item', null) + ->willReturn($itemId); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + + $itemMock->expects($this->once()) + ->method('load') + ->with($itemId, null) + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('getId') + ->willReturn(null); + + $this->redirectMock->expects($this->once()) + ->method('redirect') + ->with($this->responseMock, '*/*', []) + ->willReturn($this->responseMock); + + $this->assertEquals($this->responseMock, $this->model->execute()); + } + + public function testExecuteWithNoWishlist() + { + $itemId = 2; + $wishlistId = 1; + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getWishlistId']) + ->getMock(); + + $this->requestMock->expects($this->once()) + ->method('getParam') + ->with('item', null) + ->willReturn($itemId); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + + $itemMock->expects($this->once()) + ->method('load') + ->with($itemId, null) + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('getId') + ->willReturn($itemId); + $itemMock->expects($this->once()) + ->method('getWishlistId') + ->willReturn($wishlistId); + + $this->wishlistProviderMock->expects($this->once()) + ->method('getWishlist') + ->with($wishlistId) + ->willReturn(null); + + $this->redirectMock->expects($this->once()) + ->method('redirect') + ->with($this->responseMock, '*/*', []) + ->willReturn($this->responseMock); + + $this->assertEquals($this->responseMock, $this->model->execute()); + } + + public function testExecuteWithQuantityArray() + { + $itemId = 2; + $wishlistId = 1; + $qty = [$itemId => 3]; + $productId = 4; + $productName = 'product_name'; + $indexUrl = 'index_url'; + $configureUrl = 'configure_url'; + $options = [5 => 'option']; + $params = ['item' => $itemId, 'qty' => $qty]; + $refererUrl = 'referer_url'; + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->setMethods( + [ + 'load', + 'getId', + 'getWishlistId', + 'setQty', + 'setOptions', + 'getBuyRequest', + 'mergeBuyRequest', + 'addToCart', + 'getProduct', + 'getProductId', + ] + ) + ->getMock(); + + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('item', null) + ->willReturn($itemId); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + + $itemMock->expects($this->once()) + ->method('load') + ->with($itemId, null) + ->willReturnSelf(); + $itemMock->expects($this->exactly(2)) + ->method('getId') + ->willReturn($itemId); + $itemMock->expects($this->once()) + ->method('getWishlistId') + ->willReturn($wishlistId); + + $wishlistMock = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist') + ->disableOriginalConstructor() + ->getMock(); + + $this->wishlistProviderMock->expects($this->once()) + ->method('getWishlist') + ->with($wishlistId) + ->willReturn($wishlistMock); + + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('qty', null) + ->willReturn($qty); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with($qty[$itemId]) + ->willReturnArgument(0); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with($qty[$itemId]) + ->willReturnSelf(); + + $this->urlMock->expects($this->at(0)) + ->method('getUrl') + ->with('*/*', null) + ->willReturn($indexUrl); + + $itemMock->expects($this->once()) + ->method('getProductId') + ->willReturn($productId); + + $this->urlMock->expects($this->at(1)) + ->method('getUrl') + ->with('*/*/configure/', ['id' => $itemId, 'product_id' => $productId]) + ->willReturn($configureUrl); + + $optionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') + ->disableOriginalConstructor() + ->getMock(); + + $this->optionFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($optionMock); + + $optionsMock = $this->getMockBuilder('Magento\Wishlist\Model\Resource\Item\Option\Collection') + ->disableOriginalConstructor() + ->getMock(); + $optionMock->expects($this->once()) + ->method('getCollection') + ->willReturn($optionsMock); + + $optionsMock->expects($this->once()) + ->method('addItemFilter') + ->with([$itemId]) + ->willReturnSelf(); + $optionsMock->expects($this->once()) + ->method('getOptionsByItem') + ->with($itemId) + ->willReturn($options); + + $itemMock->expects($this->once()) + ->method('setOptions') + ->with($options) + ->willReturnSelf(); + + $this->requestMock->expects($this->once()) + ->method('getParams') + ->willReturn($params); + + $buyRequestMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getBuyRequest') + ->willReturn($buyRequestMock); + + $this->productHelperMock->expects($this->once()) + ->method('addParamsToBuyRequest') + ->with($params, ['current_config' => $buyRequestMock]) + ->willReturn($buyRequestMock); + + $itemMock->expects($this->once()) + ->method('mergeBuyRequest') + ->with($buyRequestMock) + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, true) + ->willReturn(true); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + + $quoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->setMethods(['getHasError', 'collectTotals']) + ->getMock(); + + $this->checkoutCartMock->expects($this->exactly(2)) + ->method('getQuote') + ->willReturn($quoteMock); + + $quoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $wishlistMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + + $quoteMock->expects($this->once()) + ->method('getHasError') + ->willReturn(false); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getProduct') + ->willReturn($productMock); + + $productMock->expects($this->once()) + ->method('getName') + ->willReturn($productName); + + $this->escaperMock->expects($this->once()) + ->method('escapeHtml') + ->with($productName, null) + ->willReturn($productName); + + $this->messageManagerMock->expects($this->once()) + ->method('addSuccess') + ->with('You added ' . $productName . ' to your shopping cart.', null) + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + + $this->redirectMock->expects($this->once()) + ->method('getRefererUrl') + ->willReturn($refererUrl); + + $this->helperMock->expects($this->once()) + ->method('calculate') + ->willReturnSelf(); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with($refererUrl) + ->willReturn($this->responseMock); + + $this->assertEquals($this->responseMock, $this->model->execute()); + } + + public function testExecuteWithoutQuantityArrayAndOutOfStock() + { + $itemId = 2; + $wishlistId = 1; + $qty = []; + $productId = 4; + $indexUrl = 'index_url'; + $configureUrl = 'configure_url'; + $options = [5 => 'option']; + $params = ['item' => $itemId, 'qty' => $qty]; + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->setMethods( + [ + 'load', + 'getId', + 'getWishlistId', + 'setQty', + 'setOptions', + 'getBuyRequest', + 'mergeBuyRequest', + 'addToCart', + 'getProduct', + 'getProductId', + ] + ) + ->getMock(); + + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('item', null) + ->willReturn($itemId); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + + $itemMock->expects($this->once()) + ->method('load') + ->with($itemId, null) + ->willReturnSelf(); + $itemMock->expects($this->exactly(2)) + ->method('getId') + ->willReturn($itemId); + $itemMock->expects($this->once()) + ->method('getWishlistId') + ->willReturn($wishlistId); + + $wishlistMock = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist') + ->disableOriginalConstructor() + ->getMock(); + + $this->wishlistProviderMock->expects($this->once()) + ->method('getWishlist') + ->with($wishlistId) + ->willReturn($wishlistMock); + + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('qty', null) + ->willReturn($qty); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(1) + ->willReturnArgument(0); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with(1) + ->willReturnSelf(); + + $this->urlMock->expects($this->at(0)) + ->method('getUrl') + ->with('*/*', null) + ->willReturn($indexUrl); + + $itemMock->expects($this->once()) + ->method('getProductId') + ->willReturn($productId); + + $this->urlMock->expects($this->at(1)) + ->method('getUrl') + ->with('*/*/configure/', ['id' => $itemId, 'product_id' => $productId]) + ->willReturn($configureUrl); + + $optionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') + ->disableOriginalConstructor() + ->getMock(); + + $this->optionFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($optionMock); + + $optionsMock = $this->getMockBuilder('Magento\Wishlist\Model\Resource\Item\Option\Collection') + ->disableOriginalConstructor() + ->getMock(); + $optionMock->expects($this->once()) + ->method('getCollection') + ->willReturn($optionsMock); + + $optionsMock->expects($this->once()) + ->method('addItemFilter') + ->with([$itemId]) + ->willReturnSelf(); + $optionsMock->expects($this->once()) + ->method('getOptionsByItem') + ->with($itemId) + ->willReturn($options); + + $itemMock->expects($this->once()) + ->method('setOptions') + ->with($options) + ->willReturnSelf(); + + $this->requestMock->expects($this->once()) + ->method('getParams') + ->willReturn($params); + + $buyRequestMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getBuyRequest') + ->willReturn($buyRequestMock); + + $this->productHelperMock->expects($this->once()) + ->method('addParamsToBuyRequest') + ->with($params, ['current_config' => $buyRequestMock]) + ->willReturn($buyRequestMock); + + $itemMock->expects($this->once()) + ->method('mergeBuyRequest') + ->with($buyRequestMock) + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, true) + ->willThrowException( + new \Magento\Framework\Model\Exception(null, \Magento\Wishlist\Model\Item::EXCEPTION_CODE_NOT_SALABLE) + ); + + $this->messageManagerMock->expects($this->once()) + ->method('addError') + ->with('This product(s) is out of stock.', null) + ->willReturnSelf(); + + $this->helperMock->expects($this->once()) + ->method('calculate') + ->willReturnSelf(); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with($indexUrl) + ->willReturn($this->responseMock); + + $this->assertEquals($this->responseMock, $this->model->execute()); + } + + public function testExecuteWithoutQuantityArrayAndConfigurable() + { + $itemId = 2; + $wishlistId = 1; + $qty = []; + $productId = 4; + $indexUrl = 'index_url'; + $configureUrl = 'configure_url'; + $options = [5 => 'option']; + $params = ['item' => $itemId, 'qty' => $qty]; + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->setMethods( + [ + 'load', + 'getId', + 'getWishlistId', + 'setQty', + 'setOptions', + 'getBuyRequest', + 'mergeBuyRequest', + 'addToCart', + 'getProduct', + 'getProductId', + ] + ) + ->getMock(); + + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('item', null) + ->willReturn($itemId); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + + $itemMock->expects($this->once()) + ->method('load') + ->with($itemId, null) + ->willReturnSelf(); + $itemMock->expects($this->exactly(2)) + ->method('getId') + ->willReturn($itemId); + $itemMock->expects($this->once()) + ->method('getWishlistId') + ->willReturn($wishlistId); + + $wishlistMock = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist') + ->disableOriginalConstructor() + ->getMock(); + + $this->wishlistProviderMock->expects($this->once()) + ->method('getWishlist') + ->with($wishlistId) + ->willReturn($wishlistMock); + + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('qty', null) + ->willReturn($qty); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(1) + ->willReturnArgument(0); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with(1) + ->willReturnSelf(); + + $this->urlMock->expects($this->at(0)) + ->method('getUrl') + ->with('*/*', null) + ->willReturn($indexUrl); + + $itemMock->expects($this->once()) + ->method('getProductId') + ->willReturn($productId); + + $this->urlMock->expects($this->at(1)) + ->method('getUrl') + ->with('*/*/configure/', ['id' => $itemId, 'product_id' => $productId]) + ->willReturn($configureUrl); + + $optionMock = $this->getMockBuilder('Magento\Wishlist\Model\Item\Option') + ->disableOriginalConstructor() + ->getMock(); + + $this->optionFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($optionMock); + + $optionsMock = $this->getMockBuilder('Magento\Wishlist\Model\Resource\Item\Option\Collection') + ->disableOriginalConstructor() + ->getMock(); + $optionMock->expects($this->once()) + ->method('getCollection') + ->willReturn($optionsMock); + + $optionsMock->expects($this->once()) + ->method('addItemFilter') + ->with([$itemId]) + ->willReturnSelf(); + $optionsMock->expects($this->once()) + ->method('getOptionsByItem') + ->with($itemId) + ->willReturn($options); + + $itemMock->expects($this->once()) + ->method('setOptions') + ->with($options) + ->willReturnSelf(); + + $this->requestMock->expects($this->once()) + ->method('getParams') + ->willReturn($params); + + $buyRequestMock = $this->getMockBuilder('Magento\Framework\Object') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getBuyRequest') + ->willReturn($buyRequestMock); + + $this->productHelperMock->expects($this->once()) + ->method('addParamsToBuyRequest') + ->with($params, ['current_config' => $buyRequestMock]) + ->willReturn($buyRequestMock); + + $itemMock->expects($this->once()) + ->method('mergeBuyRequest') + ->with($buyRequestMock) + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, true) + ->willThrowException( + new \Magento\Framework\Model\Exception( + 'message', + \Magento\Wishlist\Model\Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS + ) + ); + + $this->messageManagerMock->expects($this->once()) + ->method('addNotice') + ->with('message', null) + ->willReturnSelf(); + + $this->helperMock->expects($this->once()) + ->method('calculate') + ->willReturnSelf(); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with($configureUrl) + ->willReturn($this->responseMock); + + $this->assertEquals($this->responseMock, $this->model->execute()); + } +} From 642dcde1ef1ac1495c853c13cf019420ee0a1507 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 16:45:04 +0200 Subject: [PATCH 10/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - eliminate Magento\Framework\Logger\Adapter --- .../Authorizenet/Model/Authorizenet.php | 3 -- .../Magento/Authorizenet/Model/Directpost.php | 7 ++-- app/code/Magento/Centinel/Model/Api.php | 20 ++++-------- app/code/Magento/Fedex/Model/Carrier.php | 5 --- .../Magento/GoogleShopping/Model/Service.php | 32 ++++++------------- .../GoogleShopping/Model/Service/Item.php | 6 ++-- app/code/Magento/Ogone/Model/Api.php | 6 ++-- .../Payment/Model/Method/AbstractMethod.php | 23 +++---------- app/code/Magento/Payment/Model/Method/Cc.php | 12 +------ .../Magento/Payment/Model/Method/Free.php | 6 ++-- app/code/Magento/Paypal/Model/AbstractIpn.php | 19 +++-------- .../Magento/Paypal/Model/Api/AbstractApi.php | 16 +--------- app/code/Magento/Paypal/Model/Api/Nvp.php | 4 +-- .../Magento/Paypal/Model/Api/PayflowNvp.php | 3 -- app/code/Magento/Paypal/Model/Direct.php | 3 -- app/code/Magento/Paypal/Model/Express.php | 6 ++-- .../Magento/Paypal/Model/Express/Checkout.php | 14 ++------ app/code/Magento/Paypal/Model/Hostedpro.php | 3 -- app/code/Magento/Paypal/Model/Ipn.php | 6 ++-- .../Magento/Paypal/Model/Method/Agreement.php | 6 ++-- .../Magento/Paypal/Model/PayflowExpress.php | 6 ++-- app/code/Magento/Paypal/Model/Payflowlink.php | 3 -- app/code/Magento/Paypal/Model/Payflowpro.php | 3 -- .../Method/Billing/AbstractAgreement.php | 6 ++-- app/code/Magento/Paypal/Model/Standard.php | 6 ++-- .../Magento/Paypal/Model/VoidTest.php | 2 -- .../Test/Legacy/_files/obsolete_classes.php | 2 +- .../Model/BanktransferTest.php | 8 ----- .../Model/CashondeliveryTest.php | 8 ----- .../testsuite/Magento/Ogone/Model/ApiTest.php | 4 +-- .../Block/Info/ContainerAbstractTest.php | 12 +------ .../Magento/Payment/Model/Method/FreeTest.php | 4 +-- .../Magento/Paypal/Model/Api/NvpTest.php | 5 --- .../Magento/Paypal/Model/IpnTest.php | 4 +-- 34 files changed, 68 insertions(+), 205 deletions(-) diff --git a/app/code/Magento/Authorizenet/Model/Authorizenet.php b/app/code/Magento/Authorizenet/Model/Authorizenet.php index db9df42b623bb..adb6bd704f2ed 100644 --- a/app/code/Magento/Authorizenet/Model/Authorizenet.php +++ b/app/code/Magento/Authorizenet/Model/Authorizenet.php @@ -296,7 +296,6 @@ class Authorizenet extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -315,7 +314,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -338,7 +336,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index 71b481ba5f15d..ec9ef1711cedd 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -82,7 +82,6 @@ class Directpost extends \Magento\Authorizenet\Model\Authorizenet * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -107,7 +106,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -130,7 +128,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, @@ -727,7 +724,7 @@ protected function _declineOrder(\Magento\Sales\Model\Order $order, $message = ' $order->registerCancellation($message)->save(); } catch (\Exception $e) { //quiet decline - $this->_logger->critical($e); + $this->logger->critical($e); } } @@ -766,7 +763,7 @@ protected function _captureOrder(\Magento\Sales\Model\Order $order) $order->save(); } catch (\Exception $e) { //if we couldn't capture order, just leave it as NEW order. - $this->_logger->critical($e); + $this->logger->critical($e); } } } diff --git a/app/code/Magento/Centinel/Model/Api.php b/app/code/Magento/Centinel/Model/Api.php index 223b299e43d86..ccfe486b544d9 100644 --- a/app/code/Magento/Centinel/Model/Api.php +++ b/app/code/Magento/Centinel/Model/Api.php @@ -213,19 +213,17 @@ class Api extends \Magento\Framework\Object protected $_clientInstance = null; /** - * Log adapter factory - * - * @var \Psr\Log\LoggerInterface\AdapterFactory + * @var \Psr\Log\LoggerInterface */ - protected $_logFactory; + protected $logger; /** - * @param \Psr\Log\LoggerInterface\AdapterFactory $logFactory + * @param \Psr\Log\LoggerInterface $logger * @param array $data */ - public function __construct(\Psr\Log\LoggerInterface\AdapterFactory $logFactory, array $data = []) + public function __construct(\Psr\Log\LoggerInterface $logger, array $data = []) { - $this->_logFactory = $logFactory; + $this->logger = $logger; parent::__construct($data); } @@ -419,13 +417,7 @@ public function callAuthentication($data) protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logFactory->create( - ['fileName' => 'card_validation_3d_secure.log'] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - )->log( - $debugData - ); + $this->logger->debug($debugData); } } } diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 7b94207a152a7..dbd542535c5de 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -106,11 +106,6 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C */ protected $_storeManager; - /** - * @var \Psr\Log\LoggerInterface - */ - protected $_logger; - /** * @var \Magento\Catalog\Model\Resource\Product\CollectionFactory */ diff --git a/app/code/Magento/GoogleShopping/Model/Service.php b/app/code/Magento/GoogleShopping/Model/Service.php index e421d731a0647..f1a9814e9c2bd 100644 --- a/app/code/Magento/GoogleShopping/Model/Service.php +++ b/app/code/Magento/GoogleShopping/Model/Service.php @@ -32,13 +32,6 @@ class Service extends \Magento\Framework\Object */ protected $_config; - /** - * Log adapter factory - * - * @var \Psr\Log\LoggerInterface\AdapterFactory - */ - protected $_logAdapterFactory; - /** * Service * @var \Magento\Framework\Gdata\Gshopping\Content @@ -52,25 +45,25 @@ class Service extends \Magento\Framework\Object protected $_contentFactory; /** - * Constructor - * - * By default is looking for first argument as array and assigns it as object - * attributes This behavior may change in child classes - * - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @var \Psr\Log\LoggerInterface + */ + protected $logger; + + /** + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\GoogleShopping\Model\Config $config + * @param Config $config * @param \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory * @param array $data */ public function __construct( - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory, array $data = [] ) { - $this->_logAdapterFactory = $logAdapterFactory; + $this->logger = $logger; $this->_coreRegistry = $coreRegistry; $this->_config = $config; $this->_contentFactory = $contentFactory; @@ -149,12 +142,7 @@ public function getService($storeId = null) $this->_service = $this->_connect($storeId); if ($this->getConfig()->getIsDebug($storeId)) { - $this->_service->setLogAdapter( - $this->_logAdapterFactory->create(['fileName' => 'googleshopping.log']), - 'log' - )->setDebug( - true - ); + $this->_service->setLogAdapter($this->logger, 'debug')->setDebug(true); } } return $this->_service; diff --git a/app/code/Magento/GoogleShopping/Model/Service/Item.php b/app/code/Magento/GoogleShopping/Model/Service/Item.php index 3ee511cb4f371..857945556fc50 100644 --- a/app/code/Magento/GoogleShopping/Model/Service/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Service/Item.php @@ -24,7 +24,7 @@ class Item extends \Magento\GoogleShopping\Model\Service protected $_date; /** - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory @@ -33,7 +33,7 @@ class Item extends \Magento\GoogleShopping\Model\Service * @param array $data */ public function __construct( - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Registry $coreRegistry, \Magento\GoogleShopping\Model\Config $config, \Magento\Framework\Gdata\Gshopping\ContentFactory $contentFactory, @@ -43,7 +43,7 @@ public function __construct( ) { $this->_date = $date; $this->_googleShoppingHelper = $googleShoppingHelper; - parent::__construct($logAdapterFactory, $coreRegistry, $config, $contentFactory, $data); + parent::__construct($logger, $coreRegistry, $config, $contentFactory, $data); } /** diff --git a/app/code/Magento/Ogone/Model/Api.php b/app/code/Magento/Ogone/Model/Api.php index 4943812f89456..801bdfd2504c9 100644 --- a/app/code/Magento/Ogone/Model/Api.php +++ b/app/code/Magento/Ogone/Model/Api.php @@ -456,7 +456,7 @@ class Api extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\UrlInterface $urlBuilder @@ -468,7 +468,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\UrlInterface $urlBuilder, @@ -481,7 +481,7 @@ public function __construct( $this->_urlBuilder = $urlBuilder; $this->string = $string; $this->_config = $config; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); } /** diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index c50920b5d3d54..ba16262cbb2fb 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -196,34 +196,27 @@ abstract class AbstractMethod extends \Magento\Framework\Object implements Metho */ protected $_eventManager; - /** - * Log adapter factory - * - * @var \Psr\Log\LoggerInterface\AdapterFactory - */ - protected $_logAdapterFactory; + protected $logger; /** - * Construct - * * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param array $data */ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, array $data = [] ) { parent::__construct($data); + $this->logger = $logger; $this->_eventManager = $eventManager; $this->_paymentData = $paymentData; $this->_scopeConfig = $scopeConfig; - $this->_logAdapterFactory = $logAdapterFactory; } /** @@ -773,13 +766,7 @@ public function getConfigPaymentAction() protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logAdapterFactory->create( - ['fileName' => 'payment_' . $this->getCode() . '.log'] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - )->log( - $debugData - ); + $this->logger->debug($debugData); } } diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index 8cb5cbc0089b9..d7383e31db116 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -38,18 +38,10 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod */ protected $_centinelService; - /** - * Construct - * - * @var \Psr\Log\LoggerInterface - */ - protected $_logger; - /** * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -60,16 +52,14 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Centinel\Model\Service $centinelService, array $data = [] ) { - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); $this->_moduleList = $moduleList; - $this->_logger = $logger; $this->_localeDate = $localeDate; $this->_centinelService = $centinelService; } diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index 3a3bde6cd3230..7463a08bcd5dd 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -43,7 +43,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param PriceCurrencyInterface $priceCurrency * @param array $data */ @@ -51,11 +51,11 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, PriceCurrencyInterface $priceCurrency, array $data = [] ) { - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); $this->priceCurrency = $priceCurrency; } diff --git a/app/code/Magento/Paypal/Model/AbstractIpn.php b/app/code/Magento/Paypal/Model/AbstractIpn.php index 583227b62bc44..d073f605ecf17 100644 --- a/app/code/Magento/Paypal/Model/AbstractIpn.php +++ b/app/code/Magento/Paypal/Model/AbstractIpn.php @@ -9,11 +9,6 @@ class AbstractIpn { - /** - * Default log filename - */ - const DEFAULT_LOG_FILE = 'paypal_unknown_ipn.log'; - /** * @var Config */ @@ -45,18 +40,18 @@ class AbstractIpn /** * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory * @param array $data */ public function __construct( \Magento\Paypal\Model\ConfigFactory $configFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, array $data = [] ) { $this->_configFactory = $configFactory; - $this->_logAdapterFactory = $logAdapterFactory; + $this->logger = $logger; $this->_curlFactory = $curlFactory; $this->_ipnRequest = $data; } @@ -116,7 +111,7 @@ protected function _postBack() if ($response != 'VERIFIED') { $this->_addDebugData('postback', $postbackQuery); $this->_addDebugData('postback_result', $postbackResult); - throw new \Exception('PayPal IPN postback failure. See ' . self::DEFAULT_LOG_FILE . ' for details.'); + throw new \Exception('PayPal IPN postback failure. See system.log for details.'); } } @@ -168,11 +163,7 @@ protected function _filterPaymentStatus($ipnPaymentStatus) protected function _debug() { if ($this->_config && $this->_config->getConfigValue('debug')) { - $file = $this->_config - ->getMethodCode() ? "payment_{$this - ->_config - ->getMethodCode()}.log" : self::DEFAULT_LOG_FILE; - $this->_logAdapterFactory->create(['fileName' => $file])->log($this->_debugData); + $this->logger->debug($this->_debugData); } } diff --git a/app/code/Magento/Paypal/Model/Api/AbstractApi.php b/app/code/Magento/Paypal/Model/Api/AbstractApi.php index aa974746bb715..c312381e5ed63 100644 --- a/app/code/Magento/Paypal/Model/Api/AbstractApi.php +++ b/app/code/Magento/Paypal/Model/Api/AbstractApi.php @@ -96,11 +96,6 @@ abstract class AbstractApi extends \Magento\Framework\Object */ protected $_regionFactory; - /** - * @var \Psr\Log\LoggerInterface\AdapterFactory - */ - protected $_logAdapterFactory; - /** * Constructor * @@ -111,7 +106,6 @@ abstract class AbstractApi extends \Magento\Framework\Object * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param array $data */ public function __construct( @@ -119,14 +113,12 @@ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, array $data = [] ) { $this->_customerAddress = $customerAddress; $this->_logger = $logger; $this->_localeResolver = $localeResolver; $this->_regionFactory = $regionFactory; - $this->_logAdapterFactory = $logAdapterFactory; parent::__construct($data); } @@ -603,13 +595,7 @@ protected function _filterQty($value) protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logAdapterFactory->create( - ['fileName' => 'payment_' . $this->_config->getMethodCode() . '.log'] - )->setFilterDataKeys( - $this->_debugReplacePrivateDataKeys - )->log( - $debugData - ); + $this->_logger->debug($debugData); } } diff --git a/app/code/Magento/Paypal/Model/Api/Nvp.php b/app/code/Magento/Paypal/Model/Api/Nvp.php index 82dd7ada7c27e..6e1677fe98e7a 100644 --- a/app/code/Magento/Paypal/Model/Api/Nvp.php +++ b/app/code/Magento/Paypal/Model/Api/Nvp.php @@ -744,7 +744,6 @@ class Nvp extends \Magento\Paypal\Model\Api\AbstractApi * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory @@ -756,14 +755,13 @@ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, array $data = [] ) { - parent::__construct($customerAddress, $logger, $localeResolver, $regionFactory, $logAdapterFactory, $data); + parent::__construct($customerAddress, $logger, $localeResolver, $regionFactory, $data); $this->_countryFactory = $countryFactory; $this->_processableExceptionFactory = $processableExceptionFactory; $this->_frameworkExceptionFactory = $frameworkExceptionFactory; diff --git a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php index 483a3bb3980ab..7022af73abc2c 100644 --- a/app/code/Magento/Paypal/Model/Api/PayflowNvp.php +++ b/app/code/Magento/Paypal/Model/Api/PayflowNvp.php @@ -442,7 +442,6 @@ class PayflowNvp extends \Magento\Paypal\Model\Api\Nvp * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory * @param \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory @@ -456,7 +455,6 @@ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Directory\Model\RegionFactory $regionFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Paypal\Model\Api\ProcessableExceptionFactory $processableExceptionFactory, \Magento\Framework\Model\ExceptionFactory $frameworkExceptionFactory, @@ -470,7 +468,6 @@ public function __construct( $logger, $localeResolver, $regionFactory, - $logAdapterFactory, $countryFactory, $processableExceptionFactory, $frameworkExceptionFactory, diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php index e994559453220..aa6583b8087fa 100644 --- a/app/code/Magento/Paypal/Model/Direct.php +++ b/app/code/Magento/Paypal/Model/Direct.php @@ -134,7 +134,6 @@ class Direct extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -152,7 +151,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -168,7 +166,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/app/code/Magento/Paypal/Model/Express.php b/app/code/Magento/Paypal/Model/Express.php index 17c0e989059aa..126f85aaef7b2 100644 --- a/app/code/Magento/Paypal/Model/Express.php +++ b/app/code/Magento/Paypal/Model/Express.php @@ -165,7 +165,7 @@ class Express extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param ProFactory $proFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $urlBuilder @@ -178,7 +178,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, ProFactory $proFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlBuilder, @@ -187,7 +187,7 @@ public function __construct( \Magento\Framework\Model\ExceptionFactory $exception, array $data = [] ) { - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); $this->_storeManager = $storeManager; $this->_urlBuilder = $urlBuilder; $this->_cartFactory = $cartFactory; diff --git a/app/code/Magento/Paypal/Model/Express/Checkout.php b/app/code/Magento/Paypal/Model/Express/Checkout.php index 3e149d8b1e425..6f0cc27445bb3 100644 --- a/app/code/Magento/Paypal/Model/Express/Checkout.php +++ b/app/code/Magento/Paypal/Model/Express/Checkout.php @@ -198,11 +198,6 @@ class Checkout */ protected $_cartFactory; - /** - * @var \Psr\Log\LoggerInterface\AdapterFactory - */ - protected $_logFactory; - /** * @var \Magento\Checkout\Model\Type\OnepageFactory */ @@ -282,7 +277,6 @@ class Checkout * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $coreUrl * @param \Magento\Paypal\Model\CartFactory $cartFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logFactory * @param \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory * @param \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory @@ -311,7 +305,6 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $coreUrl, \Magento\Paypal\Model\CartFactory $cartFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logFactory, \Magento\Checkout\Model\Type\OnepageFactory $onepageFactory, \Magento\Sales\Model\Service\QuoteFactory $serviceQuoteFactory, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, @@ -337,7 +330,6 @@ public function __construct( $this->_storeManager = $storeManager; $this->_coreUrl = $coreUrl; $this->_cartFactory = $cartFactory; - $this->_logFactory = $logFactory; $this->_checkoutOnepageFactory = $onepageFactory; $this->_serviceQuoteFactory = $serviceQuoteFactory; $this->_agreementFactory = $agreementFactory; @@ -727,8 +719,6 @@ public function prepareOrderReview($token = null) */ public function getShippingOptionsCallbackResponse(array $request) { - // prepare debug data - $logger = $this->_logFactory->create(['fileName' => 'payment_' . $this->_methodType . '.log']); $debugData = ['request' => $request, 'response' => []]; try { @@ -750,10 +740,10 @@ public function getShippingOptionsCallbackResponse(array $request) // log request and response $debugData['response'] = $response; - $logger->log($debugData); + $this->_logger->debug($debugData); return $response; } catch (\Exception $e) { - $logger->log($debugData); + $this->_logger->critical($debugData); throw $e; } } diff --git a/app/code/Magento/Paypal/Model/Hostedpro.php b/app/code/Magento/Paypal/Model/Hostedpro.php index 1817268f56229..b3b741bffba20 100644 --- a/app/code/Magento/Paypal/Model/Hostedpro.php +++ b/app/code/Magento/Paypal/Model/Hostedpro.php @@ -71,7 +71,6 @@ class Hostedpro extends \Magento\Paypal\Model\Direct * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -90,7 +89,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -108,7 +106,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/app/code/Magento/Paypal/Model/Ipn.php b/app/code/Magento/Paypal/Model/Ipn.php index 177a575d0fdca..14329722805b2 100644 --- a/app/code/Magento/Paypal/Model/Ipn.php +++ b/app/code/Magento/Paypal/Model/Ipn.php @@ -42,7 +42,7 @@ class Ipn extends \Magento\Paypal\Model\AbstractIpn implements IpnInterface /** * @param \Magento\Paypal\Model\ConfigFactory $configFactory - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param Info $paypalInfo @@ -52,7 +52,7 @@ class Ipn extends \Magento\Paypal\Model\AbstractIpn implements IpnInterface */ public function __construct( \Magento\Paypal\Model\ConfigFactory $configFactory, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory, \Magento\Sales\Model\OrderFactory $orderFactory, Info $paypalInfo, @@ -60,7 +60,7 @@ public function __construct( CreditmemoSender $creditmemoSender, array $data = [] ) { - parent::__construct($configFactory, $logAdapterFactory, $curlFactory, $data); + parent::__construct($configFactory, $logger, $curlFactory, $data); $this->_orderFactory = $orderFactory; $this->_paypalInfo = $paypalInfo; $this->orderSender = $orderSender; diff --git a/app/code/Magento/Paypal/Model/Method/Agreement.php b/app/code/Magento/Paypal/Model/Method/Agreement.php index 936b2604146f3..e7aa4f053d3c6 100644 --- a/app/code/Magento/Paypal/Model/Method/Agreement.php +++ b/app/code/Magento/Paypal/Model/Method/Agreement.php @@ -117,7 +117,7 @@ class Agreement extends \Magento\Paypal\Model\Payment\Method\Billing\AbstractAgr * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Paypal\Model\ProFactory $proFactory @@ -131,7 +131,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Paypal\Model\ProFactory $proFactory, @@ -146,7 +146,7 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, + $logger, $agreementFactory, $data ); diff --git a/app/code/Magento/Paypal/Model/PayflowExpress.php b/app/code/Magento/Paypal/Model/PayflowExpress.php index f454a30afc893..9091042b93ccd 100644 --- a/app/code/Magento/Paypal/Model/PayflowExpress.php +++ b/app/code/Magento/Paypal/Model/PayflowExpress.php @@ -35,7 +35,7 @@ class PayflowExpress extends \Magento\Paypal\Model\Express * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param ProFactory $proFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\UrlInterface $urlBuilder @@ -49,7 +49,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, ProFactory $proFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\UrlInterface $urlBuilder, @@ -63,7 +63,7 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, + $logger, $proFactory, $storeManager, $urlBuilder, diff --git a/app/code/Magento/Paypal/Model/Payflowlink.php b/app/code/Magento/Paypal/Model/Payflowlink.php index 6be0ac4979527..1b0c78584025b 100644 --- a/app/code/Magento/Paypal/Model/Payflowlink.php +++ b/app/code/Magento/Paypal/Model/Payflowlink.php @@ -136,7 +136,6 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -159,7 +158,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -186,7 +184,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php index 0d3afe955d1a3..79b10e9805ffd 100644 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ b/app/code/Magento/Paypal/Model/Payflowpro.php @@ -216,7 +216,6 @@ class Payflowpro extends \Magento\Payment\Model\Method\Cc * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate @@ -233,7 +232,6 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, @@ -252,7 +250,6 @@ public function __construct( $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php index 008234ace9372..24f59cf482681 100644 --- a/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php +++ b/app/code/Magento/Paypal/Model/Payment/Method/Billing/AbstractAgreement.php @@ -42,7 +42,7 @@ abstract class AbstractAgreement extends \Magento\Payment\Model\Method\AbstractM * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory * @param array $data */ @@ -50,12 +50,12 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, array $data = [] ) { $this->_agreementFactory = $agreementFactory; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); } /** diff --git a/app/code/Magento/Paypal/Model/Standard.php b/app/code/Magento/Paypal/Model/Standard.php index 933fa6cd35be8..8728dcb0ee744 100644 --- a/app/code/Magento/Paypal/Model/Standard.php +++ b/app/code/Magento/Paypal/Model/Standard.php @@ -85,7 +85,7 @@ class Standard extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory + * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Session\Generic $paypalSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Framework\UrlInterface $urlBuilder @@ -102,7 +102,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Payment\Helper\Data $paymentData, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Psr\Log\LoggerInterface\AdapterFactory $logAdapterFactory, + \Psr\Log\LoggerInterface $logger, \Magento\Framework\Session\Generic $paypalSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\UrlInterface $urlBuilder, @@ -121,7 +121,7 @@ public function __construct( $this->_apiStandardFactory = $apiStandardFactory; $this->_cartFactory = $cartFactory; $this->_configFactory = $configFactory; - parent::__construct($eventManager, $paymentData, $scopeConfig, $logAdapterFactory, $data); + parent::__construct($eventManager, $paymentData, $scopeConfig, $logger, $data); } /** diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php index cb860a2a8f25f..4d7cc4a155a6e 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/VoidTest.php @@ -18,7 +18,6 @@ public function testPayflowProVoid() $paymentData = $objectManager->get('Magento\Payment\Helper\Data'); $scopeConfig = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); $logger = $objectManager->get('Psr\Log\LoggerInterface'); - $logAdapterFactory = $objectManager->get('Psr\Log\LoggerInterface\AdapterFactory'); $localeDate = $objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface'); $centinelService = $objectManager->get('Magento\Centinel\Model\Service'); $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); @@ -42,7 +41,6 @@ public function testPayflowProVoid() $eventManager, $paymentData, $scopeConfig, - $logAdapterFactory, $logger, $moduleList, $localeDate, diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 764fc631b7934..40e446b46544c 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -1980,7 +1980,7 @@ ['Magento\Core\Model\Image\Adapter\Config', 'Magento\Framework\Image\Adapter\Config'], ['Magento\Core\Model\AbstractShell', 'Magento\Framework\App\AbstractShell'], ['Magento\Core\Model\Calculator', 'Magento\Framework\Math\Calculator'], - ['Magento\Core\Model\Log\Adapter', 'Psr\Log\LoggerInterface\Adapter'], + ['Magento\Core\Model\Log\Adapter', 'Magento\Framework\Logger\Adapter'], ['Magento\Core\Model\Input\Filter', 'Magento\Framework\Filter\Input'], ['Magento\Core\Model\Input\Filter\MaliciousCode', 'Magento\Framework\Filter\Input\MaliciousCode'], ['Magento\Core\Model\Option\ArrayInterface', 'Magento\Framework\Option\ArrayInterface'], diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php index 16d951af2fc30..03f21339f631b 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/BanktransferTest.php @@ -17,20 +17,12 @@ protected function setUp() $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $adapterFactoryMock = $this->getMock( - 'Psr\Log\LoggerInterface\AdapterFactory', - ['create'], - [], - '', - false - ); $this->_object = $objectManagerHelper->getObject( 'Magento\OfflinePayments\Model\Banktransfer', [ 'eventManager' => $eventManager, 'paymentData' => $paymentDataMock, 'scopeConfig' => $scopeConfig, - 'logAdapterFactory' => $adapterFactoryMock ] ); } diff --git a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php index 7cac02dbe88e1..2f3cb65cfc398 100644 --- a/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php +++ b/dev/tests/unit/testsuite/Magento/OfflinePayments/Model/CashondeliveryTest.php @@ -17,13 +17,6 @@ protected function setUp() $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); - $adapterFactoryMock = $this->getMock( - 'Psr\Log\LoggerInterface\AdapterFactory', - ['create'], - [], - '', - false - ); $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); $this->_object = $helper->getObject( @@ -32,7 +25,6 @@ protected function setUp() 'eventManager' => $eventManager, 'paymentData' => $paymentDataMock, 'scopeConfig' => $scopeConfig, - 'logAdapterFactory' => $adapterFactoryMock ] ); } diff --git a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php index 535adca0f1bcd..ba85434f7d110 100644 --- a/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php +++ b/dev/tests/unit/testsuite/Magento/Ogone/Model/ApiTest.php @@ -25,12 +25,12 @@ public function testTranslate() $config = $this->getMock('Magento\Ogone\Model\Config', [], [], '', false); $paymentDataMock = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $loggerFactory = $this->getMock('\Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); + $logger = $this->getMock('\Psr\Log\LoggerInterface'); $object = new \Magento\Ogone\Model\Api( $eventManager, $paymentDataMock, $scopeConfig, - $loggerFactory, + $logger, $storeManager, $localeResolver, $urlBuilder, diff --git a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php index 22fca248a05e5..a2974944cb1df 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php @@ -21,17 +21,7 @@ public function testSetInfoTemplate() ); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $paymentInfo = $objectManagerHelper->getObject('Magento\Payment\Model\Info'); - $adapterFactoryMock = $this->getMock( - 'Psr\Log\LoggerInterface\AdapterFactory', - ['create'], - [], - '', - false - ); - $methodInstance = $objectManagerHelper->getObject( - 'Magento\OfflinePayments\Model\Checkmo', - ['logAdapterFactory' => $adapterFactoryMock] - ); + $methodInstance = $objectManagerHelper->getObject('Magento\OfflinePayments\Model\Checkmo'); $paymentInfo->setMethodInstance($methodInstance); $block->expects($this->atLeastOnce())->method('getPaymentInfo')->will($this->returnValue($paymentInfo)); diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php index dd3d95bf9d5c4..11571cbb2f964 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/Method/FreeTest.php @@ -20,14 +20,14 @@ protected function setUp() $eventManager = $this->getMock('Magento\Framework\Event\ManagerInterface', [], [], '', false); $paymentData = $this->getMock('Magento\Payment\Helper\Data', [], [], '', false); $this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface', [], [], '', false); - $logAdapterFactory = $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $this->currencyPrice = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface')->getMock(); $this->methodFree = new \Magento\Payment\Model\Method\Free( $eventManager, $paymentData, $this->scopeConfig, - $logAdapterFactory, + $logger, $this->currencyPrice ); } diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php index 2c18495c669d8..1c9c5f7f644a4 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/Api/NvpTest.php @@ -24,9 +24,6 @@ class NvpTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Directory\Model\RegionFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $regionFactory; - /** @var \PHPUnit_Framework_MockObject_MockObject */ - protected $adapterFactory; - /** @var \Magento\Directory\Model\CountryFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $countryFactory; @@ -48,7 +45,6 @@ protected function setUp() $this->logger = $this->getMock('Psr\Log\LoggerInterface'); $this->resolver = $this->getMock('Magento\Framework\Locale\ResolverInterface'); $this->regionFactory = $this->getMock('Magento\Directory\Model\RegionFactory', [], [], '', false); - $this->adapterFactory = $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false); $this->countryFactory = $this->getMock('Magento\Directory\Model\CountryFactory', [], [], '', false); $processableExceptionFactory = $this->getMock( 'Magento\Paypal\Model\Api\ProcessableExceptionFactory', @@ -88,7 +84,6 @@ protected function setUp() 'logger' => $this->logger, 'localeResolver' => $this->resolver, 'regionFactory' => $this->regionFactory, - 'logAdapterFactory' => $this->adapterFactory, 'countryFactory' => $this->countryFactory, 'processableExceptionFactory' => $processableExceptionFactory, 'frameworkExceptionFactory' => $exceptionFactory, diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php index 6a8c89d399744..4eb7539b36b77 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/IpnTest.php @@ -101,7 +101,7 @@ protected function setUp() $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', [ 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false), + 'logger' => $this->getMock('Psr\Log\LoggerInterface'), 'curlFactory' => $this->curlFactory, 'orderFactory' => $this->_orderMock, 'paypalInfo' => $this->_paypalInfo, @@ -180,7 +180,7 @@ public function testPaymentReviewRegisterPaymentFraud() $this->_ipn = $objectHelper->getObject('Magento\Paypal\Model\Ipn', [ 'configFactory' => $this->configFactory, - 'logAdapterFactory' => $this->getMock('Psr\Log\LoggerInterface\AdapterFactory', [], [], '', false), + 'logger' => $this->getMock('Psr\Log\LoggerInterface'), 'curlFactory' => $this->curlFactory, 'orderFactory' => $this->_orderMock, 'paypalInfo' => $this->_paypalInfo, From 887e6bc9e79ed0d98eaa49c943912eb8d54963e8 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 16:51:52 +0200 Subject: [PATCH 11/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - eliminate Magento\Framework\Logger\Adapter --- app/code/Magento/Store/Model/StorageFactory.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Store/Model/StorageFactory.php b/app/code/Magento/Store/Model/StorageFactory.php index 0ec394d477064..edcf2110824c0 100644 --- a/app/code/Magento/Store/Model/StorageFactory.php +++ b/app/code/Magento/Store/Model/StorageFactory.php @@ -30,11 +30,6 @@ class StorageFactory */ protected $_eventManager; - /** - * @var \Psr\Log\LoggerInterface - */ - protected $_log; - /** * @var \Magento\Framework\Session\SidResolverInterface */ From d4d6361c2e0974a7fe7355c564c7585cec495fc6 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Fri, 19 Dec 2014 16:57:21 +0200 Subject: [PATCH 12/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - fixed grammatical error --- app/etc/di.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/etc/di.xml b/app/etc/di.xml index 09307c527d582..60364ef243e5f 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -85,13 +85,13 @@ - + var/log/system.log Monolog\Logger::DEBUG - + var/log/exception.log Monolog\Logger::CRITICAL @@ -101,8 +101,8 @@ main - Monolog\Heandler\Stream\Exception - Monolog\Heandler\Stream\System + Monolog\Handler\Stream\Exception + Monolog\Handler\Stream\System From d6e9146361ed1527461bf2eff4dea5ec6c6460a0 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Mon, 22 Dec 2014 18:48:11 +0200 Subject: [PATCH 13/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - replace log and logException calls - fixed bug with unexisting log directory --- .../Controller/Adminhtml/Index/Create.php | 4 +- .../Controller/Adminhtml/Index/Rollback.php | 4 +- .../Model/Carrier/AbstractCarrier.php | 2 +- app/etc/di.xml | 16 +----- .../Magento/TestFramework/ErrorLog/Logger.php | 12 +---- .../Framework/Logger/Handler/Critical.php | 21 ++++++++ .../Framework/Logger/Handler/System.php | 51 +++++++++++++++++++ 7 files changed, 81 insertions(+), 29 deletions(-) create mode 100644 lib/internal/Magento/Framework/Logger/Handler/Critical.php create mode 100644 lib/internal/Magento/Framework/Logger/Handler/System.php diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php index 654697d038df5..d594ed0907050 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php @@ -86,10 +86,10 @@ public function execute() } catch (\Magento\Framework\Backup\Exception\NotEnoughFreeSpace $e) { $errorMessage = __('You need more free space to create a backup.'); } catch (\Magento\Framework\Backup\Exception\NotEnoughPermissions $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); $errorMessage = __('You need more permissions to create a backup.'); } catch (\Exception $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); $errorMessage = __('Something went wrong creating the backup.'); } diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php index c10b5b37c5bf8..20723783b18fa 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Rollback.php @@ -122,10 +122,10 @@ public function execute() } catch (\Magento\Framework\Backup\Exception\FtpValidationFailed $e) { $errorMsg = __('Failed to validate FTP'); } catch (\Magento\Framework\Backup\Exception\NotEnoughPermissions $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); $errorMsg = __('Not enough permissions to perform rollback.'); } catch (\Exception $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->log($e->getMessage()); + $this->_objectManager->get('Psr\Log\LoggerInterface')->info($e->getMessage()); $errorMsg = __('Failed to rollback'); } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index cb490cc476ca8..1f695dcf1e696 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -568,7 +568,7 @@ public function isZipCodeRequired($countryId = null) protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logger->log($debugData); + $this->_logger->info($debugData); } } diff --git a/app/etc/di.xml b/app/etc/di.xml index 60364ef243e5f..f048c38392d2b 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -85,24 +85,12 @@ - - - var/log/system.log - Monolog\Logger::DEBUG - - - - - var/log/exception.log - Monolog\Logger::CRITICAL - - main - Monolog\Handler\Stream\Exception - Monolog\Handler\Stream\System + Magento\Framework\Logger\Handler\Critical + Magento\Framework\Logger\Handler\System diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php index 1b52381998eec..842d3ffe5632e 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php @@ -4,7 +4,7 @@ */ namespace Magento\TestFramework\ErrorLog; -class Logger extends \Psr\Log\LoggerInterface +class Logger extends \Monolog\Logger { /** @var array */ protected $messages = []; @@ -21,6 +21,7 @@ class Logger extends \Psr\Log\LoggerInterface public function __construct() { $this->minimumErrorLevel = defined('TESTS_ERROR_LOG_LISTENER_LEVEL') ? TESTS_ERROR_LOG_LISTENER_LEVEL : -1; + parent::__construct('integration-test'); } /** @@ -38,13 +39,4 @@ public function getMessages() { return $this->messages; } - - /** - * @param string $message - * @internal param int $level - */ - public function info($message) - { - parent::info($message); - } } diff --git a/lib/internal/Magento/Framework/Logger/Handler/Critical.php b/lib/internal/Magento/Framework/Logger/Handler/Critical.php new file mode 100644 index 0000000000000..1f2a1950179d3 --- /dev/null +++ b/lib/internal/Magento/Framework/Logger/Handler/Critical.php @@ -0,0 +1,21 @@ +filesystem = $filesystem; + parent::__construct(BP . $this->fileName, $this->loggerType); + } + + /** + * @{inerhitDoc} + * + * @param $record array + */ + public function write(array $record) + { + $logDir = $this->filesystem->getParentDirectory($this->url); + if (!$this->filesystem->isDirectory($logDir)) { + $this->filesystem->createDirectory($logDir, 0777); + } + parent::write($record); + } +} From 271fd759630c50cdbec4362a2c65a00fd567e8b5 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Mon, 22 Dec 2014 18:59:01 +0200 Subject: [PATCH 14/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- .../framework/Magento/TestFramework/ErrorLog/Listener.php | 2 +- lib/internal/Magento/Framework/Logger/Handler/System.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php index ce2720accacd8..e86373e49f132 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Listener.php @@ -72,7 +72,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) */ public function startTest(\PHPUnit_Framework_Test $test) { - $this->logger = Helper\Bootstrap::getObjectManager()->get('Psr\Log\LoggerInterface'); + $this->logger = Helper\Bootstrap::getObjectManager()->get('Magento\TestFramework\ErrorLog\Logger'); $this->logger->clearMessages(); } diff --git a/lib/internal/Magento/Framework/Logger/Handler/System.php b/lib/internal/Magento/Framework/Logger/Handler/System.php index b3f799e56cc66..d836d7df376f9 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/System.php +++ b/lib/internal/Magento/Framework/Logger/Handler/System.php @@ -5,7 +5,7 @@ namespace Magento\Framework\Logger\Handler; -use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\Filesystem\DriverInterface; use Monolog\Handler\StreamHandler; use Monolog\Logger; @@ -22,14 +22,14 @@ class System extends StreamHandler protected $loggerType = Logger::DEBUG; /** - * @var File + * @var DriverInterface */ protected $filesystem; /** - * @param File $filesystem + * @param DriverInterface $filesystem */ - public function __construct(File $filesystem) + public function __construct(DriverInterface $filesystem) { $this->filesystem = $filesystem; parent::__construct(BP . $this->fileName, $this->loggerType); From c62be57a024c6214ed0e0b5656ce4ca378d5e55b Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Mon, 22 Dec 2014 19:04:49 +0200 Subject: [PATCH 15/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- app/etc/di.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/etc/di.xml b/app/etc/di.xml index f048c38392d2b..e0be4971c62f7 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -85,6 +85,11 @@ + + + Magento\Framework\Filesystem\Driver\File + + main From 588314dba8708f24f31feb265df494f0c1c3dff3 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Tue, 23 Dec 2014 12:00:43 +0200 Subject: [PATCH 16/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- app/code/Magento/Payment/Model/Method/AbstractMethod.php | 3 +++ .../Integration/Service/V1/AuthorizationServiceTest.php | 2 +- lib/internal/Magento/Framework/Logger/Handler/System.php | 1 + lib/internal/Magento/Framework/Logger/README.md | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 lib/internal/Magento/Framework/Logger/README.md diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index ba16262cbb2fb..70ef8ea29f338 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -196,6 +196,9 @@ abstract class AbstractMethod extends \Magento\Framework\Object implements Metho */ protected $_eventManager; + /** + * @var \Psr\Log\LoggerInterface + */ protected $logger; /** diff --git a/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php b/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php index 11217c53e37e4..7192622e0c53b 100644 --- a/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Service/V1/AuthorizationServiceTest.php @@ -25,7 +25,7 @@ protected function setUp() { parent::setUp(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $loggerMock = $this->getMockBuilder('Magento\\Framework\\Logger')->disableOriginalConstructor()->getMock(); + $loggerMock = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->disableOriginalConstructor()->getMock(); $loggerMock->expects($this->any())->method('critical')->will($this->returnSelf()); $this->_service = $objectManager->create( 'Magento\Integration\Service\V1\AuthorizationService', diff --git a/lib/internal/Magento/Framework/Logger/Handler/System.php b/lib/internal/Magento/Framework/Logger/Handler/System.php index d836d7df376f9..6bc2157a558a8 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/System.php +++ b/lib/internal/Magento/Framework/Logger/Handler/System.php @@ -39,6 +39,7 @@ public function __construct(DriverInterface $filesystem) * @{inerhitDoc} * * @param $record array + * @return void */ public function write(array $record) { diff --git a/lib/internal/Magento/Framework/Logger/README.md b/lib/internal/Magento/Framework/Logger/README.md new file mode 100644 index 0000000000000..2d2b0410de1d1 --- /dev/null +++ b/lib/internal/Magento/Framework/Logger/README.md @@ -0,0 +1,3 @@ +# Logger + +**Logger** provides a standard mechanism to log to system and error logs. From 738d3755edf9064cc4eed43defb866a89b4e4346 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Tue, 23 Dec 2014 12:17:54 +0200 Subject: [PATCH 17/24] MAGETWO-32095: Modify .gitignore CE according to new repos structure --- dev/tests/functional/.gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/.gitignore b/dev/tests/functional/.gitignore index f12c1a579105c..d3b32c5f1d405 100755 --- a/dev/tests/functional/.gitignore +++ b/dev/tests/functional/.gitignore @@ -3,6 +3,9 @@ /generated /var /config/* -!/config/*.dist +!/config/application.yml.dist +!/config/handler.yml.dist +!/config/isolation.yml.dist +!/config/server.yml.dist phpunit.xml /lib/Mtf/Util/Generate/testcase.xml From b3ac09acbc2f5e125566d43c4b6311a16a79e8b6 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Tue, 23 Dec 2014 12:38:52 +0200 Subject: [PATCH 18/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- composer.lock | 112 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 7cb7c6f857a44..3aa9ff558933f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "cf88c5db8e11255eb97498f788609028", + "hash": "25a2a2ff9de53c394a797011b0f84855", "packages": [ { "name": "composer/composer", @@ -178,6 +178,116 @@ ], "time": "2014-12-12 15:28:16" }, + { + "name": "monolog/monolog", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", + "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "~2.4, >2.4.8", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "phpunit/phpunit": "~3.7.0", + "raven/raven": "~0.5", + "ruflin/elastica": "0.90.*", + "videlalvaro/php-amqplib": "~2.4" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "raven/raven": "Allow sending log messages to a Sentry server", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2014-09-30 13:30:58" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, { "name": "seld/jsonlint", "version": "1.3.0", From 6fabce0c69fb9fc87d99f65e377324a984b436ab Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Tue, 23 Dec 2014 14:35:42 +0200 Subject: [PATCH 19/24] MAGETWO-13915: PSR-3: common interface for logging libraries. --- app/etc/di.xml | 4 ++-- .../Magento/TestFramework/ErrorLog/Logger.php | 2 +- lib/internal/Magento/Framework/Logger/Monolog.php | 12 ++++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 lib/internal/Magento/Framework/Logger/Monolog.php diff --git a/app/etc/di.xml b/app/etc/di.xml index 6d5a7d369eca9..c5259bd3c8766 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -5,7 +5,7 @@ */ --> - + @@ -91,7 +91,7 @@ Magento\Framework\Filesystem\Driver\File - + main diff --git a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php index 842d3ffe5632e..d548626cee8f8 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ErrorLog/Logger.php @@ -4,7 +4,7 @@ */ namespace Magento\TestFramework\ErrorLog; -class Logger extends \Monolog\Logger +class Logger extends \Magento\Framework\Logger\Monolog { /** @var array */ protected $messages = []; diff --git a/lib/internal/Magento/Framework/Logger/Monolog.php b/lib/internal/Magento/Framework/Logger/Monolog.php new file mode 100644 index 0000000000000..304528bf4c917 --- /dev/null +++ b/lib/internal/Magento/Framework/Logger/Monolog.php @@ -0,0 +1,12 @@ + Date: Wed, 24 Dec 2014 15:20:46 +0200 Subject: [PATCH 20/24] MAGETWO-31961: Exception when add configurable product from wishlist into cart(problem with product id and item_id) --- app/code/Magento/Core/Model/Layout/Merge.php | 40 ++++++++++++++++--- .../layout/checkout_cart_configure.xml | 1 + .../layout/wishlist_index_configure.xml | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index d12c1a07b963d..4ada264841123 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -132,6 +132,27 @@ class Merge implements \Magento\Framework\View\Layout\ProcessorInterface */ protected $cacheSuffix; + /** + * Status for new added handle + * + * @var int + */ + protected $handleAdded = 1; + + /** + * Status for handle being processed + * + * @var int + */ + protected $handleProcessing = 2; + + /** + * Status for processed handle + * + * @var int + */ + protected $handleProcessed = 3; + /** * Init merge model * @@ -217,10 +238,10 @@ public function addHandle($handleName) { if (is_array($handleName)) { foreach ($handleName as $name) { - $this->_handles[$name] = 1; + $this->_handles[$name] = $this->handleAdded; } } else { - $this->_handles[$handleName] = 1; + $this->_handles[$handleName] = $this->handleAdded; } return $this; } @@ -477,8 +498,17 @@ protected function _loadXmlString($xmlString) */ protected function _merge($handle) { - $this->_fetchPackageLayoutUpdates($handle); - $this->_fetchDbLayoutUpdates($handle); + if (!isset($this->_handles[$handle]) || $this->_handles[$handle] == $this->handleAdded) { + $this->_handles[$handle] = $this->handleProcessing; + $this->_fetchPackageLayoutUpdates($handle); + $this->_fetchDbLayoutUpdates($handle); + $this->_handles[$handle] = $this->handleProcessed; + } elseif ($this->_handles[$handle] == $this->handleProcessing + && $this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER + ) { + $this->_logger->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM); + $this->_logger->log('Cyclic dependency in merged layout for handle: ' . $handle, \Zend_Log::ERR); + } return $this; } @@ -573,8 +603,6 @@ protected function _fetchRecursiveUpdates($updateXml) foreach ($updateXml->children() as $child) { if (strtolower($child->getName()) == 'update' && isset($child['handle'])) { $this->_merge((string)$child['handle']); - // Adding merged layout handle to the list of applied handles - $this->addHandle((string)$child['handle']); } } if (isset($updateXml['layout'])) { diff --git a/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml b/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml index 94b9ab8477231..046550a20b834 100644 --- a/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml +++ b/app/code/Magento/Review/view/frontend/layout/checkout_cart_configure.xml @@ -5,6 +5,7 @@ */ --> + diff --git a/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml index 94b9ab8477231..046550a20b834 100644 --- a/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml +++ b/app/code/Magento/Review/view/frontend/layout/wishlist_index_configure.xml @@ -5,6 +5,7 @@ */ --> + From f5c8db9d850c05df9b2e026331fec5cc6b324cd4 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Wed, 24 Dec 2014 18:38:32 +0200 Subject: [PATCH 21/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - remove unusable values from config --- app/code/Magento/Core/etc/config.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Core/etc/config.xml b/app/code/Magento/Core/etc/config.xml index 77708c9752012..dda5079bb16a5 100644 --- a/app/code/Magento/Core/etc/config.xml +++ b/app/code/Magento/Core/etc/config.xml @@ -19,11 +19,6 @@ 0 - - 0 - system.log - exception.log - 0 0 From 7d85edf41541a6342dcfdf2c3814032fe95cbb6c Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Wed, 24 Dec 2014 18:42:07 +0200 Subject: [PATCH 22/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - fix after merge --- app/code/Magento/Core/Model/Layout/Merge.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Core/Model/Layout/Merge.php b/app/code/Magento/Core/Model/Layout/Merge.php index fd0fb54b23f2a..a1533f98efb5b 100644 --- a/app/code/Magento/Core/Model/Layout/Merge.php +++ b/app/code/Magento/Core/Model/Layout/Merge.php @@ -505,8 +505,7 @@ protected function _merge($handle) } elseif ($this->_handles[$handle] == $this->handleProcessing && $this->_appState->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER ) { - $this->_logger->addStreamLog(\Magento\Framework\Logger::LOGGER_SYSTEM); - $this->_logger->log('Cyclic dependency in merged layout for handle: ' . $handle, \Zend_Log::ERR); + $this->_logger->info('Cyclic dependency in merged layout for handle: ' . $handle); } return $this; } From 6c71ee9673238bd9dd7e1ecd5d9aa91b7242ba6a Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Wed, 24 Dec 2014 19:16:38 +0200 Subject: [PATCH 23/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - remove backend configuration for log --- .../Magento/Backend/etc/adminhtml/system.xml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index fb99df20fc9dd..888b0855bb972 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -193,23 +193,6 @@ Translate, blocks and other output caches should be disabled for both frontend and admin inline translations. - - - - - Magento\Backend\Model\Config\Source\Yesno - - - - Magento\Backend\Model\Config\Backend\Filename - Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log - - - - Magento\Backend\Model\Config\Backend\Filename - Logging from \Psr\Log\LoggerInterface. File is located in {{base_dir}}/var/log - - From db238eedaeccf507d6127f35f5b25e2ab9639393 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 25 Dec 2014 14:48:39 +0200 Subject: [PATCH 24/24] MAGETWO-13915: PSR-3: common interface for logging libraries. - split debug and info log type to separate files --- app/code/Magento/Backend/Model/Menu.php | 4 ++-- .../Backend/Model/Menu/Director/Director.php | 2 +- .../Model/Carrier/AbstractCarrier.php | 2 +- app/code/Magento/Ups/Model/Carrier.php | 2 +- app/etc/di.xml | 1 + .../Image/Adapter/AbstractAdapter.php | 2 +- .../Framework/Logger/Handler/Debug.php | 21 +++++++++++++++++++ .../Framework/Logger/Handler/System.php | 2 +- .../Magento/Framework/Message/Manager.php | 2 +- .../Framework/View/Layout/Generator/Block.php | 2 +- .../View/Layout/ScheduledStructure/Helper.php | 2 +- 11 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 lib/internal/Magento/Framework/Logger/Handler/Debug.php diff --git a/app/code/Magento/Backend/Model/Menu.php b/app/code/Magento/Backend/Model/Menu.php index 582ab34871e32..79fd68d8edb74 100644 --- a/app/code/Magento/Backend/Model/Menu.php +++ b/app/code/Magento/Backend/Model/Menu.php @@ -55,7 +55,7 @@ public function add(\Magento\Backend\Model\Menu\Item $item, $parentId = null, $i $index = intval($index); if (!isset($this[$index])) { $this->offsetSet($index, $item); - $this->_logger->debug( + $this->_logger->info( sprintf('Add of item with id %s was processed', $item->getId()) ); } else { @@ -120,7 +120,7 @@ public function remove($itemId) if ($item->getId() == $itemId) { unset($this[$key]); $result = true; - $this->_logger->debug( + $this->_logger->info( sprintf('Remove on item with id %s was processed', $item->getId()) ); break; diff --git a/app/code/Magento/Backend/Model/Menu/Director/Director.php b/app/code/Magento/Backend/Model/Menu/Director/Director.php index ccd4f69f11e9a..0d77330ecb0c5 100644 --- a/app/code/Magento/Backend/Model/Menu/Director/Director.php +++ b/app/code/Magento/Backend/Model/Menu/Director/Director.php @@ -24,7 +24,7 @@ protected function _getCommand($data, $logger) { $command = $this->_commandFactory->create($data['type'], ['data' => $data]); if (isset($this->_messagePatterns[$data['type']])) { - $logger->debug( + $logger->info( sprintf($this->_messagePatterns[$data['type']], $command->getId()) ); } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php index 1f695dcf1e696..21a384ed8845e 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrier.php @@ -568,7 +568,7 @@ public function isZipCodeRequired($countryId = null) protected function _debug($debugData) { if ($this->getDebugFlag()) { - $this->_logger->info($debugData); + $this->_logger->debug($debugData); } } diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index fca08cfbd1e1a..8a5ea44b6eff8 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -515,7 +515,7 @@ protected function _parseCgiResponse($response) $message = __( 'Sorry, something went wrong. Please try again or contact us and we\'ll try to help.' ); - $this->_logger->info($message . ': ' . $errorTitle); + $this->_logger->debug($message . ': ' . $errorTitle); break; case 6: if (in_array($row[3], $allowedMethods)) { diff --git a/app/etc/di.xml b/app/etc/di.xml index c5259bd3c8766..5fa642e9363e6 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -97,6 +97,7 @@ Magento\Framework\Logger\Handler\Critical Magento\Framework\Logger\Handler\System + Magento\Framework\Logger\Handler\Debug diff --git a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php index c6baaa318678a..bd5b3a6cf2375 100644 --- a/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php +++ b/lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php @@ -675,7 +675,7 @@ protected function _prepareDestination($destination = null, $newName = null) try { $this->directoryWrite->create($this->directoryWrite->getRelativePath($destination)); } catch (\Magento\Framework\Filesystem\FilesystemException $e) { - $this->logger->info($e->getMessage()); + $this->logger->critical($e); throw new \Exception('Unable to write file into directory ' . $destination . '. Access forbidden.'); } } diff --git a/lib/internal/Magento/Framework/Logger/Handler/Debug.php b/lib/internal/Magento/Framework/Logger/Handler/Debug.php new file mode 100644 index 0000000000000..ed360efb95dd0 --- /dev/null +++ b/lib/internal/Magento/Framework/Logger/Handler/Debug.php @@ -0,0 +1,21 @@ +getTraceAsString() ); - $this->logger->debug($message); + $this->logger->critical($message); $this->addMessage($this->messageFactory->create(MessageInterface::TYPE_ERROR, $alternativeText), $group); return $this; } diff --git a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php index 1fb604e81f1f4..1b192f422b044 100644 --- a/lib/internal/Magento/Framework/View/Layout/Generator/Block.php +++ b/lib/internal/Magento/Framework/View/Layout/Generator/Block.php @@ -172,7 +172,7 @@ protected function getBlockInstance($block, array $arguments = []) try { $block = $this->blockFactory->createBlock($block, $arguments); } catch (\ReflectionException $e) { - $this->logger->info($e->getMessage()); + $this->logger->critical($e->getMessage()); } } if (!$block instanceof \Magento\Framework\View\Element\AbstractBlock) { diff --git a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php index 0c919eb96ea43..e0258bdcff72e 100644 --- a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php +++ b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php @@ -185,7 +185,7 @@ public function scheduleElement( try { $structure->setAsChild($name, $parentName, $alias); } catch (\Exception $e) { - $this->logger->info($e->getMessage()); + $this->logger->critical($e); } } else { $this->logger->info(