CoreFiles by mySites.guru
Logger.php75 lines, 1,726 bytes, from Joomla_4.2.6-Stable-Full_Package.zip
Raw History Compare with 4.2.5
md5
8ae545af23383a101a1b62a9e733e9e7
sha1
5d3b674eadd5e0be7767d0f8cf0fafbc7dc7eb90
sha256
058c432dc8362953dcb488bae8004519bf0f52492188d99cf8ea342b68af9e28
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Log;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Joomla! Logger Base Class
 *
 * This class is used to be the basis of logger classes to allow for defined functions
 * to exist regardless of the child class.
 *
 * @since  3.0.1
 */
abstract class Logger
{
    /**
     * Options array for the Log instance.
     *
     * @var    array
     * @since  3.0.1
     */
    protected $options = array();

    /**
     * Translation array for LogEntry priorities to text strings.
     *
     * @var    array
     * @since  3.0.1
     */
    protected $priorities = array(
        Log::EMERGENCY => 'EMERGENCY',
        Log::ALERT     => 'ALERT',
        Log::CRITICAL  => 'CRITICAL',
        Log::ERROR     => 'ERROR',
        Log::WARNING   => 'WARNING',
        Log::NOTICE    => 'NOTICE',
        Log::INFO      => 'INFO',
        Log::DEBUG     => 'DEBUG',
    );

    /**
     * Constructor.
     *
     * @param   array  &$options  Log object options.
     *
     * @since   3.0.1
     */
    public function __construct(array &$options)
    {
        // Set the options for the class.
        $this->options = & $options;
    }

    /**
     * Method to add an entry to the log.
     *
     * @param   LogEntry  $entry  The log entry object to add to the log.
     *
     * @return  void
     *
     * @since   3.0.1
     * @throws  \RuntimeException
     */
    abstract public function addEntry(LogEntry $entry);
}

The same content is in 11 releases, Joomla 4.2.1 to 4.3.0-alpha2. See them all, or every version of this file.