- md5
- 4bc1ab9a959ef76e54b0b91363d4a230
- sha1
- 0bb74b28158f434f1d706cd423c23a730bbe5e24
- sha256
- 11130095ce24f716438e18ab5099cf0c0bb2e31da66f98ebe264f0c0b30d9212
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
<?php
/**
* @package Joomla.Platform
* @subpackage Log
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
jimport('joomla.utilities.date');
/**
* Joomla! Log Entry class
*
* This class is designed to hold log entries for either writing to an engine, or for
* supported engines, retrieving lists and building in memory (PHP based) search operations.
*
* @package Joomla.Platform
* @subpackage Log
* @since 11.1
*/
class JLogEntry
{
/**
* Application responsible for log entry.
* @var string
* @since 11.1
*/
public $category;
/**
* The date the message was logged.
* @var JDate
* @since 11.1
*/
public $date;
/**
* Message to be logged.
* @var string
* @since 11.1
*/
public $message;
/**
* The priority of the message to be logged.
* @var string
* @since 11.1
* @see $priorities
*/
public $priority = JLog::INFO;
/**
* List of available log priority levels [Based on the SysLog default levels].
* @var array
* @since 11.1
*/
protected $priorities = array(
JLog::EMERGENCY,
JLog::ALERT,
JLog::CRITICAL,
JLog::ERROR,
JLog::WARNING,
JLog::NOTICE,
JLog::INFO,
JLog::DEBUG
);
/**
* Constructor
*
* @param string $message The message to log.
* @param string $priority Message priority based on {$this->priorities}.
* @param string $category Type of entry
* @param string $date Date of entry (defaults to now if not specified or blank)
*
* @since 11.1
*/
public function __construct($message, $priority = JLog::INFO, $category = '', $date = null)
{
$this->message = (string) $message;
// Sanitize the priority.
if (!in_array($priority, $this->priorities, true))
{
$priority = JLog::INFO;
}
$this->priority = $priority;
// Sanitize category if it exists.
if (!empty($category))
{
$this->category = (string) strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $category));
}
// Get the date as a JDate object.
$this->date = new JDate($date ? $date : 'now');
}
}
The same content is in 9 releases, Joomla 2.5.0 to 2.5.8. See them all, or every version of this file.