Source for file logger.php

Documentation is available at logger.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Platform
  4.  * @subpackage  Log
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. /**
  13.  * Joomla! Logger Base Class
  14.  *
  15.  * This class is used to be the basis of logger classes to allow for defined functions
  16.  * to exist regardless of the child class.
  17.  *
  18.  * @package     Joomla.Platform
  19.  * @subpackage  Log
  20.  * @since       12.2
  21.  */
  22. abstract class JLogLogger
  23. {
  24.     /**
  25.      * Options array for the JLog instance.
  26.      * @var    array 
  27.      * @since  12.2
  28.      */
  29.     protected $options = array();
  30.  
  31.     /**
  32.      * @var    array  Translation array for JLogEntry priorities to text strings.
  33.      * @since  12.2
  34.      */
  35.     protected $priorities = array(
  36.         JLog::EMERGENCY => 'EMERGENCY',
  37.         JLog::ALERT => 'ALERT',
  38.         JLog::CRITICAL => 'CRITICAL',
  39.         JLog::ERROR => 'ERROR',
  40.         JLog::WARNING => 'WARNING',
  41.         JLog::NOTICE => 'NOTICE',
  42.         JLog::INFO => 'INFO',
  43.         JLog::DEBUG => 'DEBUG');
  44.  
  45.     /**
  46.      * Constructor.
  47.      *
  48.      * @param   array  &$options  Log object options.
  49.      *
  50.      * @since   12.2
  51.      */
  52.     public function __construct(array &$options)
  53.     {
  54.         // Set the options for the class.
  55.         $this->options $options;
  56.     }
  57.  
  58.     /**
  59. /**
  60.      * Method to add an entry to the log.
  61.      *
  62.      * @param   JLogEntry  $entry  The log entry object to add to the log.
  63.      *
  64.      * @return  void 
  65.      *
  66.      * @since   12.2
  67.      */
  68.     abstract public function addEntry(JLogEntry $entry);
  69. }
  70.  
  71. /**
  72.  * Deprecated class placeholder.  You should use JLogLogger instead.
  73.  *
  74.  * @package     Joomla.Platform
  75.  * @subpackage  Log
  76.  * @since       11.1
  77.  * @deprecated  13.3 (Platform) & 4.0 (CMS)
  78.  * @codeCoverageIgnore
  79.  */
  80. abstract class JLogger extends JLogLogger
  81. {
  82.     /**
  83.      * Constructor.
  84.      *
  85.      * @param   array  &$options  Log object options.
  86.      *
  87.      * @since   11.1
  88.      * @deprecated  13.3
  89.      */
  90.     public function __construct(array &$options)
  91.     {
  92.         JLog::add('JLogger is deprecated. Use JLogLogger instead.'JLog::WARNING'deprecated');
  93.         parent::__construct($options);
  94.     }
  95. }

Documentation generated on Tue, 19 Nov 2013 15:07:25 +0100 by phpDocumentor 1.4.3