[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Log/ -> Logger.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Log;
  11  
  12  // phpcs:disable PSR1.Files.SideEffects
  13  \defined('JPATH_PLATFORM') or die;
  14  // phpcs:enable PSR1.Files.SideEffects
  15  
  16  /**
  17   * Joomla! Logger Base Class
  18   *
  19   * This class is used to be the basis of logger classes to allow for defined functions
  20   * to exist regardless of the child class.
  21   *
  22   * @since  3.0.1
  23   */
  24  abstract class Logger
  25  {
  26      /**
  27       * Options array for the Log instance.
  28       *
  29       * @var    array
  30       * @since  3.0.1
  31       */
  32      protected $options = array();
  33  
  34      /**
  35       * Translation array for LogEntry priorities to text strings.
  36       *
  37       * @var    array
  38       * @since  3.0.1
  39       */
  40      protected $priorities = array(
  41          Log::EMERGENCY => 'EMERGENCY',
  42          Log::ALERT     => 'ALERT',
  43          Log::CRITICAL  => 'CRITICAL',
  44          Log::ERROR     => 'ERROR',
  45          Log::WARNING   => 'WARNING',
  46          Log::NOTICE    => 'NOTICE',
  47          Log::INFO      => 'INFO',
  48          Log::DEBUG     => 'DEBUG',
  49      );
  50  
  51      /**
  52       * Constructor.
  53       *
  54       * @param   array  &$options  Log object options.
  55       *
  56       * @since   3.0.1
  57       */
  58      public function __construct(array &$options)
  59      {
  60          // Set the options for the class.
  61          $this->options = & $options;
  62      }
  63  
  64      /**
  65       * Method to add an entry to the log.
  66       *
  67       * @param   LogEntry  $entry  The log entry object to add to the log.
  68       *
  69       * @return  void
  70       *
  71       * @since   3.0.1
  72       * @throws  \RuntimeException
  73       */
  74      abstract public function addEntry(LogEntry $entry);
  75  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer