Merge pull request #21981 from woocommerce/fix/21422

Log file timestamp should be UTC
This commit is contained in:
Claudiu Lodromanean 2018-11-21 12:59:46 -08:00 committed by GitHub
commit 152b609c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -99,10 +99,14 @@ class WC_Logger implements WC_Logger_Interface {
*/
public function add( $handle, $message, $level = WC_Log_Levels::NOTICE ) {
$message = apply_filters( 'woocommerce_logger_add_message', $message, $handle );
$this->log( $level, $message, array(
'source' => $handle,
'_legacy' => true,
) );
$this->log(
$level,
$message,
array(
'source' => $handle,
'_legacy' => true,
)
);
wc_do_deprecated_action( 'woocommerce_log_add', array( $handle, $message ), '3.0', 'This action has been deprecated with no alternative.' );
return true;
}
@ -129,7 +133,7 @@ class WC_Logger implements WC_Logger_Interface {
}
if ( $this->should_handle( $level ) ) {
$timestamp = current_time( 'timestamp' );
$timestamp = current_time( 'timestamp', 1 );
$message = apply_filters( 'woocommerce_logger_log_message', $message, $level, $context );
foreach ( $this->handlers as $handler ) {