Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
echo.php
Aller à la documentation de ce fichier.
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 Echo logger class.
14  *
15  * @package Joomla.Platform
16  * @subpackage Log
17  * @since 11.1
18  */
20 {
21  /**
22  * @var string Value to use at the end of an echoed log entry to separate lines.
23  * @since 11.1
24  */
25  protected $line_separator = "\n";
26 
27  /**
28  * Constructor.
29  *
30  * @param array &$options Log object options.
31  *
32  * @since 12.1
33  */
34  public function __construct(array &$options)
35  {
36  parent::__construct($options);
37 
38  if (!empty($this->options['line_separator']))
39  {
40  $this->line_separator = $this->options['line_separator'];
41  }
42  }
43 
44  /**
45  * Method to add an entry to the log.
46  *
47  * @param JLogEntry $entry The log entry object to add to the log.
48  *
49  * @return void
50  *
51  * @since 11.1
52  */
53  public function addEntry(JLogEntry $entry)
54  {
55  echo $this->priorities[$entry->priority] . ': '
56  . $entry->message . (empty($entry->category) ? '' : ' [' . $entry->category . ']')
57  . $this->line_separator;
58  }
59 }