I am trying to track down some bugs in an extension, but I need answers from the core code (specifically vendor/magento/module-quote/Model/QuoteRepository.php).
I've tried adding "private $_logger;" to the class declarations, along with adding to the constructor:
public function __construct(
QuoteFactory $quoteFactory,
StoreManagerInterface $storeManager,
\Magento\Quote\Model\ResourceModel\Quote\Collection $quoteCollection,
\Magento\Quote\Api\Data\CartSearchResultsInterfaceFactory $searchResultsDataFactory,
JoinProcessorInterface $extensionAttributesJoinProcessor,
\Psr\Log\LoggerInterface $logger
) {
$this->quoteFactory = $quoteFactory;
$this->storeManager = $storeManager;
$this->searchResultsDataFactory = $searchResultsDataFactory;
$this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor;
$this->_logger = $logger;
}
Then I try to write to the log like this:
public function get($cartId, array $sharedStoreIds = [])
{
$this->_logger->log(\Psr\Log\LogLevel::DEBUG, 'Hello I wrote to the log!');
when the page runs I get the error:
Fatal error: Uncaught TypeError: Argument 6 passed to Magento\Quote\Model\QuoteRepository::__construct() must implement interface Psr\Log\LoggerInterface, none given, called in /home/livean9/public_new/var/generation/Magento/Quote/Model/QuoteRepository/Interceptor.php on line 14 and defined in /home/livean9/public_new/vendor/magento/module-quote/Model/QuoteRepository.php:89
What am I doing wrong?