WooCommerce::log_errors()
Ensures fatal errors are logged so they can be picked up in the status report.
Description Description
Source Source
File: includes/class-woocommerce.php
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 );
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.2.0 | Introduced. |