Mark WC_Log_Handler::format_entry abstract
This commit is contained in:
parent
5f24eca7e2
commit
acc98a1d6a
|
@ -46,8 +46,8 @@ abstract class WC_Log_Handler {
|
||||||
*
|
*
|
||||||
* @return string Formatted log entry.
|
* @return string Formatted log entry.
|
||||||
*/
|
*/
|
||||||
public function format_entry( $timestamp, $level, $message, $context ) {
|
public static function format_entry( $timestamp, $level, $message, $context ) {
|
||||||
$time_string = $this->format_time( $timestamp );
|
$time_string = self::format_time( $timestamp );
|
||||||
$level_string = strtoupper( $level );
|
$level_string = strtoupper( $level );
|
||||||
$entry = "{$time_string} {$level_string} {$message}";
|
$entry = "{$time_string} {$level_string} {$message}";
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ class WC_Log_Handler_File extends WC_Log_Handler {
|
||||||
$handle = 'log';
|
$handle = 'log';
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry = $this->format_entry( $timestamp, $level, $message, $context );
|
$entry = self::format_entry( $timestamp, $level, $message, $context );
|
||||||
|
|
||||||
return $this->add( $entry, $handle );
|
return $this->add( $entry, $handle );
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class WC_Log_Handler_File extends WC_Log_Handler {
|
||||||
*
|
*
|
||||||
* @return string Formatted log entry.
|
* @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['_legacy'] ) && true === $context['_legacy'] ) {
|
||||||
if ( isset( $context['tag'] ) && $context['tag'] ) {
|
if ( isset( $context['tag'] ) && $context['tag'] ) {
|
||||||
|
|
Loading…
Reference in New Issue