Tribe__Log::get_current_logger()

Returns the currently active logger.

If no loggers are available, this will be the null logger which is a no-op implementation (making it safe to call TribeLogLogger methods on the return value of this method at all times).


Return

(Tribe__Log__Logger)


Top ↑

Source

File: src/Tribe/Log.php

	public function get_current_logger() {
		if ( ! $this->current_logger ) {
			$engine = tribe_get_option( 'logging_class', null );
			$available = $this->get_logging_engines();

			if ( empty( $engine ) || ! isset( $available[ $engine ] ) ) {
				return $this->current_logger = new Tribe__Log__Null_Logger();
			} else {
				$this->current_logger = $this->get_engine( $engine );
			}
		}

		return $this->current_logger;
	}

Top ↑

Changelog

Changelog
Version Description
4.6.2 Introduced.