Skip to content
Snippets Groups Projects
Commit 5482c28a authored by dyszczo's avatar dyszczo
Browse files

PB-587 Fatal przy nadawaniu przesyłki - multiple wc capture

parent 59dd4a5a
No related branches found
No related tags found
1 merge request!12PB-587 Fatal przy nadawaniu przesyłki - multiple wc capture
Pipeline #6736 failed
## [1.5.4] - 2019-05-06
### Fixed
- Exception: must be an instance of WC_Logger, instance of WPDesk\Logger\WC\WooCommerceMonologPlugin given
## [1.5.3] - 2019-04-25
### Fixed
- Exception while trying to disable log
......
......@@ -21,7 +21,7 @@ class WooCommerceMonologPlugin implements \WC_Logger_Interface
/** @var \WC_Logger */
private $originalWCLogger;
public function __construct(Logger $monolog, \WC_Logger $originalLogger)
public function __construct(Logger $monolog, \WC_Logger_Interface $originalLogger)
{
$this->monolog = $monolog;
$this->originalWCLogger = $originalLogger;
......
......@@ -69,7 +69,7 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
* Assumptions:
* - logger is actively working when 'wpdesk_helper_options' has 'debug_log' set to '1';
* - fatal errors, exception and standard errors are recorded but in a transparent way;
* - WooCommerce logger is captured and returns this logger;
* - WooCommerce logger is captured and returns this logger; That is true of default logger is instantiated.
* - logs are still correctly written to WooCommerce subsystem in a transparent way;
* - all recorded errors are written to WPDesk file.
*
......@@ -87,10 +87,11 @@ class WPDeskLoggerFactory extends BasicLoggerFactory
}
$logger = $this->createLogger($name);
$this->captureWooCommerce($logger);
$this->appendMainLog($logger);
if ($name !== self::DEFAULT_LOGGER_CHANNEL_NAME) {
$this->appendFileLog($logger, $this->getFileName($name));
} else {
$this->captureWooCommerce($logger);
}
return $logger;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment