diff --git a/includes/abstracts/abstract-wc-log-handler.php b/includes/abstracts/abstract-wc-log-handler.php index 5a4e5e0c2a7..7de5c76cc16 100644 --- a/includes/abstracts/abstract-wc-log-handler.php +++ b/includes/abstracts/abstract-wc-log-handler.php @@ -46,8 +46,8 @@ abstract class WC_Log_Handler { * * @return string Formatted log entry. */ - public function format_entry( $timestamp, $level, $message, $context ) { - $time_string = $this->format_time( $timestamp ); + public static function format_entry( $timestamp, $level, $message, $context ) { + $time_string = self::format_time( $timestamp ); $level_string = strtoupper( $level ); $entry = "{$time_string} {$level_string} {$message}"; diff --git a/includes/log-handlers/class-wc-log-handler-file.php b/includes/log-handlers/class-wc-log-handler-file.php index 4b2e7b63e25..984279d77ad 100644 --- a/includes/log-handlers/class-wc-log-handler-file.php +++ b/includes/log-handlers/class-wc-log-handler-file.php @@ -79,7 +79,7 @@ class WC_Log_Handler_File extends WC_Log_Handler { $handle = 'log'; } - $entry = $this->format_entry( $timestamp, $level, $message, $context ); + $entry = self::format_entry( $timestamp, $level, $message, $context ); return $this->add( $entry, $handle ); } @@ -94,7 +94,7 @@ class WC_Log_Handler_File extends WC_Log_Handler { * * @return string Formatted log entry. */ - public function format_entry( $timestamp, $level, $message, $context ) { + public static function format_entry( $timestamp, $level, $message, $context ) { if ( isset( $context['_legacy'] ) && true === $context['_legacy'] ) { if ( isset( $context['tag'] ) && $context['tag'] ) {