Automattic\WooCommerce\Internal\PushNotifications\Services

StepLogQuery::get_logging_state │ public │ WC 11.3.0

Returns the store's logging state: the settings that decide whether step lines are written and kept, the store's token count, and the caps a line's token lists are cut to, so a reader can tell a short list from a truncated one.

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

Хуков нет.

Возвращает

array.

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

$StepLogQuery = new StepLogQuery();
$StepLogQuery->get_logging_state(): array;

Список изменений

С версии 11.3.0 Введена.

Код StepLogQuery::get_logging_state() WC 11.3.0

public function get_logging_state(): array {
	$directory = Settings::get_log_directory( false );

	return array(
		'logging_enabled'        => LoggingUtil::logging_is_enabled(),
		'push_logging_enabled'   => $this->step_logger->is_active(),
		'default_handler'        => LoggingUtil::get_default_handler(),
		'level_threshold'        => LoggingUtil::get_level_threshold(),
		'retention_period_days'  => LoggingUtil::get_retention_period(),
		'log_directory_writable' => is_dir( $directory ) && wp_is_writable( $directory ),
		'token_count'            => $this->data_store->count_tokens(),
		'recipient_id_cap'       => NotificationProcessor::RECIPIENT_ID_CAP,
		'max_array_items'        => NotificationStepLogger::MAX_ARRAY_ITEMS,
	);
}