WC_Log_Handler::format_entry( int $timestamp, string $level, string $message, array $context )

Builds a log entry text from level, timestamp and message.


Description Description


Parameters Parameters

$timestamp

(Required) Log timestamp.

$level

(Required) emergency|alert|critical|error|warning|notice|info|debug.

$message

(Required) Log message.

$context

(Required) Additional information for log handlers.


Top ↑

Return Return

(string) Formatted log entry.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-log-handler.php

	protected static function format_entry( $timestamp, $level, $message, $context ) {
		$time_string  = self::format_time( $timestamp );
		$level_string = strtoupper( $level );
		$entry        = "{$time_string} {$level_string} {$message}";

		return apply_filters(
			'woocommerce_format_log_entry',
			$entry,
			array(
				'timestamp' => $timestamp,
				'level'     => $level,
				'message'   => $message,
				'context'   => $context,
			)
		);
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.