Created TlogDestinationRotatingFile and set it the default destination

This commit is contained in:
Franck Allimant
2014-01-25 00:30:09 +01:00
parent 3e3ecc8edf
commit c2b310fd73
4 changed files with 118 additions and 38 deletions

View File

@@ -26,31 +26,29 @@ namespace Thelia\Log;
abstract class AbstractTlogDestination
{
//Tableau de TlogDestinationConfig paramétrant la destination
protected $_configs;
protected $_configs = array();
//Tableau des lignes de logs stockés avant utilisation par ecrire()
protected $_logs;
protected $_logs = array();
public function __construct()
{
$this->_configs = array();
$this->_logs = array();
// Initialiser les variables de configuration
$this->_configs = $this->getConfigs();
$this->_configs = $this->getConfigs();
// Appliquer la configuration
$this->configure();
}
//Affecte une valeur à une configuration de la destination
public function setConfig($name, $value)
public function setConfig($name, $value, $apply_changes = true)
{
foreach ($this->_configs as $config) {
if ($config->getName() == $name) {
$config->setValue($value);
// Appliquer les changements
$this->configure();
if ($apply_changes) $this->configure();
return true;
}