Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors

EvaluationLogger::log()publicWC 1.0

Log the results.

Метод класса: EvaluationLogger{}

Возвращает

null. Ничего (null).

Использование

$EvaluationLogger = new EvaluationLogger();
$EvaluationLogger->log();

Код EvaluationLogger::log() WC 9.7.1

public function log() {
	$should_log = defined( 'WC_ADMIN_DEBUG_RULE_EVALUATOR' ) && true === constant( 'WC_ADMIN_DEBUG_RULE_EVALUATOR' );

	/**
	 * Filter to determine if the rule evaluator should log the results.
	 *
	 * @since 9.2.0
	 *
	 * @param bool $should_log Whether the rule evaluator should log the results.
	 */
	if ( ! apply_filters( 'woocommerce_admin_remote_specs_evaluator_should_log', $should_log ) ) {
		return;
	}

	foreach ( $this->results as $result ) {
		$this->logger->debug(
			"[{$this->slug}] {$result['rule']}: {$result['result']}",
			array( 'source' => $this->source )
		);
	}
}