Skip to content
Snippets Groups Projects

bugfix(wc logger): initialisation

Merged Grzegorz Rola requested to merge bugfix/wc-logger into master
2 files
+ 6
2
Compare changes
  • Side-by-side
  • Inline

Files

+ 1
1
@@ -33,7 +33,7 @@ final class SimpleLoggerFactory implements LoggerFactory {
@@ -33,7 +33,7 @@ final class SimpleLoggerFactory implements LoggerFactory {
$this->logger = new Logger( $this->channel );
$this->logger = new Logger( $this->channel );
if ( $this->options->use_wc_log ) {
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();
$this->create_wc_handler();
} else {
} else {
\add_action( 'woocommerce_init', [ $this, 'create_wc_handler' ] );
\add_action( 'woocommerce_init', [ $this, 'create_wc_handler' ] );
Loading