Enhance woocommerce_logger_log_message filter

This commit is contained in:
Caleb Burks 2021-04-01 19:37:39 -05:00
parent 1c40a28409
commit 7706b199c5
1 changed files with 6 additions and 3 deletions

View File

@ -139,11 +139,14 @@ class WC_Logger implements WC_Logger_Interface {
}
if ( $this->should_handle( $level ) ) {
$timestamp = current_time( 'timestamp', 1 );
$message = apply_filters( 'woocommerce_logger_log_message', $message, $level, $context );
$timestamp = time();
foreach ( $this->handlers as $handler ) {
$handler->handle( $timestamp, $level, $message, $context );
$message = apply_filters( 'woocommerce_logger_log_message', $message, $level, $context, $handler );
if ( null !== $message ) {
$handler->handle( $timestamp, $level, $message, $context );
}
}
}
}