Mark WC_Log_Handler::format_entry abstract

This commit is contained in:
Jon Surrell 2016-12-16 20:44:09 +01:00
parent 5f24eca7e2
commit acc98a1d6a
2 changed files with 4 additions and 4 deletions

View File

@ -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}";

View File

@ -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'] ) {