wc_register_default_log_handler()WC 3.0

Registers the default log handler.

No Hooks.

Return

Array.

Usage

wc_register_default_log_handler( $handlers );
$handlers(array) (required)
Handlers.

Changelog

Since 3.0 Introduced.

wc_register_default_log_handler() code WC 7.3.0

function wc_register_default_log_handler( $handlers ) {
	$handler_class = Constants::get_constant( 'WC_LOG_HANDLER' );
	if ( is_null( $handler_class ) || ! class_exists( $handler_class ) ) {
		$handler_class = WC_Log_Handler_File::class;
	}

	array_push( $handlers, new $handler_class() );

	return $handlers;
}