File "LoggingTrait.php"

Full Path: /home/vantageo/public_html/cache/.wp-cli/wp-content/plugins/facebook-for-woocommerce/includes/Jobs/LoggingTrait.php
File size: 610 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
// phpcs:ignoreFile

namespace WooCommerce\Facebook\Jobs;

use WC_Facebookcommerce;

defined( 'ABSPATH' ) || exit;

/**
 * Trait LoggingTrait
 *
 * Logging helper trait for jobs.
 *
 * @since 2.5.0
 */
trait LoggingTrait {

	/**
	 * Get the name/slug of the job.
	 *
	 * @return string
	 */
	abstract public function get_name(): string;

	/**
	 * Write a log entry using the plugin's logger.
	 *
	 * @param string $message
	 */
	protected function log( string $message ) {
		facebook_for_woocommerce()->log(
			$message,
			sprintf( '%s_%s', WC_Facebookcommerce::PLUGIN_ID, $this->get_name() )
		);
	}
}