WordPress at Your Fingertips
function is not described

WooCommerce::log_errors() public WC 3.2.0

Ensures fatal errors are logged so they can be picked up in the status report.

{} It's a method of the class: WooCommerce{}

Hooks from the method
Return

null. Nothing.

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->log_errors();

Changelog

Since 3.2.0 Introduced.

Code of WooCommerce::log_errors() WC 5.7.1

public function log_errors() {
	$error = error_get_last();
	if ( $error && in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
		$logger = wc_get_logger();
		$logger->critical(
			/* translators: 1: error message 2: file name and path 3: line number */
			sprintf( __( '%1$s in %2$s on line %3$s', 'woocommerce' ), $error['message'], $error['file'], $error['line'] ) . PHP_EOL,
			array(
				'source' => 'fatal-errors',
			)
		);
		do_action( 'woocommerce_shutdown_error', $error );
	}
}