checkout-magento2-plugin
checkout-magento2-plugin copied to clipboard
Magento 2.4.2 broken debugging
With debugging enabled, I'm getting the error:
TypeError: Argument 2 passed to Monolog\Logger::debug() must be of the type array, string given
Coming from:
$this->logger->additional('authorization header: ' . $key, 'auth');
which calls
$this->logger->debug('Checkout Logging: ', $msg);
in \CheckoutCom\Magento2\Helper\Logger::write
as Monolog\Logger::debug is expecting an array as second argument.
It seems it might just need to be concatenated instead?
* @param string $message The log message
* @param array $context The log context
* @return bool Whether the record has been processed
*/
public function debug($message, array $context = array())
(Also slight note on Magento 2.4.4 is using different version than 2.4.3 of Monolog.)
Although I also notice sometimes arrays are passed to \CheckoutCom\Magento2\Helper\Logger::additional so will need better fixing than concat.