WC_Log_Handler::format_entry()
Builds a log entry text from level, timestamp and message.
Method of the class: WC_Log_Handler{}
Hooks from the method
Return
String
. Formatted log entry.
Usage
$result = WC_Log_Handler::format_entry( $timestamp, $level, $message, $context );
- $timestamp(int) (required)
- Log timestamp.
- $level(string) (required)
- emergency|alert|critical|error|warning|notice|info|debug.
- $message(string) (required)
- Log message.
- $context(array) (required)
- Additional information for log handlers.
WC_Log_Handler::format_entry() WC Log Handler::format entry code WC 9.2.3
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}"; /** * Filter the formatted log entry before it is written. * * @since 3.0.0 * * @param string $entry The formatted entry. * @param array $args The raw data that gets assembled into a log entry. */ return apply_filters( 'woocommerce_format_log_entry', $entry, array( 'timestamp' => $timestamp, 'level' => $level, 'message' => $message, 'context' => $context, ) ); }