Automattic\WooCommerce\Internal\Logging

RemoteLogger::is_remote_logging_allowedpublicWC 1.0

Determines if remote logging is allowed based on the following conditions:

  1. The feature flag for remote error logging is enabled.
  2. The user has opted into tracking/logging.
  3. The store is allowed to log based on the variant assignment percentage.
  4. The current WooCommerce version is the latest so we don't log errors that might have been fixed in a newer version.

Method of the class: RemoteLogger{}

No Hooks.

Returns

true|false.

Usage

$RemoteLogger = new RemoteLogger();
$RemoteLogger->is_remote_logging_allowed();

RemoteLogger::is_remote_logging_allowed() code WC 10.7.0

public function is_remote_logging_allowed() {
	if ( ! FeaturesUtil::feature_is_enabled( 'remote_logging' ) ) {
		return false;
	}

	if ( ! WC_Site_Tracking::is_tracking_enabled() ) {
		return false;
	}

	if ( ! $this->should_current_version_be_logged() ) {
		return false;
	}

	return true;
}