Canonical_Formatter::format( array $record )

Formats a log record.


Parameters #

$record

(array) (Required) A record to format.


Top ↑

Return #

(mixed) The formatted record.


Top ↑

Source #

File: src/Tribe/Log/Canonical_Formatter.php

	public function format( array $record ) {
		$has_context = ! empty( $record['context'] );

		if ( $has_context ) {
			$record['message'] = $this->format_record_message( $record );

			$this->format = 'tribe-canonical-line channel=%channel% %message%';
		} else {
			// Fall-back on a standard format if the message does not have a context.
			$this->format = 'tribe.%channel%.%level_name%: %message%';
		}

		return parent::format( $record );
	}

Top ↑

Changelog #

Changelog
Version Description
4.9.16 Introduced.