WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Logger::__construct() public WC 1.0

Constructor for the logger.

Это метод класса: WC_Logger{}

Хуки из метода
Возвращает

Null. Ничего.

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

$WC_Logger = new WC_Logger();
$WC_Logger->__construct( $handlers, $threshold );
$handlers(массив)
Array of log handlers. If $handlers is not provided, the filter 'woocommerce_register_log_handlers' will be used to define the handlers. If $handlers is provided, the filter will not be applied and the handlers will be used directly.
По умолчанию: null
$threshold(строка)
Define an explicit threshold. May be configured via WC_LOG_THRESHOLD. By default, all logs will be processed.
По умолчанию: null

Код WC_Logger::__construct() WC 4.5.2

woocommerce/includes/class-wc-logger.php
<?php
public function __construct( $handlers = null, $threshold = null ) {
	if ( null === $handlers ) {
		$handlers = apply_filters( 'woocommerce_register_log_handlers', array() );
	}

	$register_handlers = array();

	if ( ! empty( $handlers ) && is_array( $handlers ) ) {
		foreach ( $handlers as $handler ) {
			$implements = class_implements( $handler );
			if ( is_object( $handler ) && is_array( $implements ) && in_array( 'WC_Log_Handler_Interface', $implements, true ) ) {
				$register_handlers[] = $handler;
			} else {
				wc_doing_it_wrong(
					__METHOD__,
					sprintf(
						/* translators: 1: class name 2: WC_Log_Handler_Interface */
						__( 'The provided handler %1$s does not implement %2$s.', 'woocommerce' ),
						'<code>' . esc_html( is_object( $handler ) ? get_class( $handler ) : $handler ) . '</code>',
						'<code>WC_Log_Handler_Interface</code>'
					),
					'3.0'
				);
			}
		}
	}

	// Support the constant as long as a valid log level has been set for it.
	if ( null === $threshold ) {
		$threshold = Constants::get_constant( 'WC_LOG_THRESHOLD' );
		if ( null !== $threshold && ! WC_Log_Levels::is_valid_level( $threshold ) ) {
			$threshold = null;
		}
	}

	if ( null !== $threshold ) {
		$threshold = WC_Log_Levels::get_level_severity( $threshold );
	}

	$this->handlers  = $register_handlers;
	$this->threshold = $threshold;
}