diff --git a/CHANGELOG.md b/CHANGELOG.md index a295bc383ae017f0295842a618feca2ccdf99be2..b0fcfb004c2420ede892023e3f825acd43a81002 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## [1.12.0] - 2023-07-10 +## [1.12.1] - 2024-03-26 +### Fixed +- WC logger initialisation + +## [1.12.0] - 2024-03-19 ### Added - sensitive data replacer diff --git a/src/SimpleLoggerFactory.php b/src/SimpleLoggerFactory.php index cf88a942db65ab9b6cf927da30b79f326c17635b..432be72df25962f2c9b697f28a5d237e3e9bfa36 100644 --- a/src/SimpleLoggerFactory.php +++ b/src/SimpleLoggerFactory.php @@ -33,7 +33,7 @@ final class SimpleLoggerFactory implements LoggerFactory { $this->logger = new Logger( $this->channel ); if ( $this->options->use_wc_log ) { - if ( \function_exists( 'wc_get_logger' ) ) { + if ( \function_exists( 'wc_get_logger' ) && \did_action( 'woocommerce_init' ) ) { $this->create_wc_handler(); } else { \add_action( 'woocommerce_init', [ $this, 'create_wc_handler' ] );