From c05c17d9474f780b1c59d9a62ed064f7c5436a98 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 20 Nov 2018 12:46:52 +0200 Subject: [PATCH 1/2] Timestamp should be in UTC since we use date( 'c' ) for outputting the date/time in the file. --- includes/class-wc-logger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-logger.php b/includes/class-wc-logger.php index c2fb5e17288..8aa8c445eef 100644 --- a/includes/class-wc-logger.php +++ b/includes/class-wc-logger.php @@ -129,7 +129,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 ) { From 47226ae2bf4b05cef968b49b4f46e710a6a842bf Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 20 Nov 2018 12:54:59 +0200 Subject: [PATCH 2/2] PHPCS fixes --- includes/class-wc-logger.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/class-wc-logger.php b/includes/class-wc-logger.php index 8aa8c445eef..9f0a68e22c6 100644 --- a/includes/class-wc-logger.php +++ b/includes/class-wc-logger.php @@ -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; }