Automattic\WooCommerce\Internal\PushNotifications\Services

NotificationStepLogger::log_unattributed_failure │ public │ WC 11.3.0

Records a failure that happened before a notification could be identified, such as a loopback request that failed authorization.

Written under the module's own source only, since there is no journey to attach it to; the read path includes that source for the days in range.

Method of the class: NotificationStepLogger{}

No Hooks.

Returns

void. Nothing (null).

Usage

$NotificationStepLogger = new NotificationStepLogger();
$NotificationStepLogger->log_unattributed_failure( $step, $outcome, $level, $message, $context ): void;
$step(string) (required)
Machine-readable step name, e.g. loopback_started.
$outcome(string) (required)
Machine-readable outcome, e.g. auth_failed.
$level(string) (required)
error or warning.
$message(string) (required)
Human-readable message for the error log.
$context(array)
Extra scalar fields to store with the line.
Default: array()

Changelog

Since 11.3.0 Introduced.

NotificationStepLogger::log_unattributed_failure() code WC 11.3.0

public function log_unattributed_failure( string $step, string $outcome, string $level, string $message, array $context = array() ): void {
	$context['step']    = $step;
	$context['outcome'] = $outcome;

	$this->write_error( $level, $message, $context );
}