Log error's file and line number

To help with debugging.
This commit is contained in:
Brent Shepherd 2018-07-13 14:23:17 +10:00
parent 0c17fd49e4
commit febea645f9
1 changed files with 2 additions and 1 deletions

View File

@ -186,7 +186,8 @@ final class WooCommerce {
if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ) ) ) {
$logger = wc_get_logger();
$logger->critical(
$error['message'] . PHP_EOL,
/* 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',
)