I'm trying to log some info in the existing Magento 2 module just to check if the code is running or not. Following files have been modified to log info.
Magento\Checkout\Block\Cart\Item\Renderer.php
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Checkout\Block\Cart\Item;
.
.
.
.
use Psr\Log\LoggerInterface;
.
.
.
protected $_logger;
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
.
.
LoggerInterface $logger,
array $data = []
) {
.
.
.
$this->logger = $logger;
parent::__construct($context, $data);
.
.
.
}
.
.
.
public function getProductOptions()
{
/* @var $helper \Magento\Catalog\Helper\Product\Configuration */
$helper = $this->_productConfig;
$this->_logger->debug('Product Options');
return $helper->getCustomOptions($this->getItem());
}
I'm getting following error.
Exception #0 (Exception): Recoverable Error: Argument 10 passed to Magento\Checkout\Block\Cart\Item\Renderer::__construct() must implement interface Psr\Log\LoggerInterface, array given, called in /Applications/MAMP/htdocs/magentoce21/vendor/magento/module-bundle/Block/Checkout/Cart/Item/Renderer.php on line 65 and defined in /Applications/MAMP/htdocs/magentoce21/vendor/magento/module-checkout/Block/Cart/Item/Renderer.php on line 120