normalize Tlog in english
This commit is contained in:
@@ -45,10 +45,10 @@ class TlogDestinationFile extends AbstractTlogDestination
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function configurer()
|
||||
public function configure()
|
||||
{
|
||||
$file_path = $this->get_config(self::VAR_PATH_FILE);
|
||||
$mode = strtolower($this->get_config(self::VAR_MODE)) == 'a' ? 'a' : 'w';
|
||||
$file_path = $this->getConfig(self::VAR_PATH_FILE);
|
||||
$mode = strtolower($this->getConfig(self::VAR_MODE)) == 'a' ? 'a' : 'w';
|
||||
|
||||
if (! empty($file_path)) {
|
||||
if (! is_file($file_path)) {
|
||||
@@ -64,17 +64,17 @@ class TlogDestinationFile extends AbstractTlogDestination
|
||||
}
|
||||
}
|
||||
|
||||
public function get_titre()
|
||||
public function getTitle()
|
||||
{
|
||||
return "Text File";
|
||||
}
|
||||
|
||||
public function get_description()
|
||||
public function getDescription()
|
||||
{
|
||||
return "Store logs into text file";
|
||||
}
|
||||
|
||||
public function get_configs()
|
||||
public function getConfigs()
|
||||
{
|
||||
return array(
|
||||
new TlogDestinationConfig(
|
||||
@@ -94,14 +94,14 @@ class TlogDestinationFile extends AbstractTlogDestination
|
||||
);
|
||||
}
|
||||
|
||||
public function ajouter($texte)
|
||||
public function add($texte)
|
||||
{
|
||||
if ($this->fh) {
|
||||
fwrite($this->fh, $texte."\n");
|
||||
}
|
||||
}
|
||||
|
||||
public function ecrire(&$res)
|
||||
public function write(&$res)
|
||||
{
|
||||
if ($this->fh) @fclose($this->fh);
|
||||
|
||||
|
||||
@@ -27,51 +27,50 @@ use Thelia\Log\AbstractTlogDestination;
|
||||
|
||||
class TlogDestinationHtml extends AbstractTlogDestination
|
||||
{
|
||||
// Nom des variables de configuration
|
||||
// ----------------------------------
|
||||
const VAR_STYLE = "tlog_destinationhtml_style";
|
||||
const VALEUR_STYLE_DEFAUT = "text-align: left; font-size: 12px; font-weight: normal; line-height: 14px; float: none; display:block; color: #000; background-color: #fff; font-family: Courier New, courier,fixed;";
|
||||
// Nom des variables de configuration
|
||||
// ----------------------------------
|
||||
const VAR_STYLE = "tlog_destinationhtml_style";
|
||||
const VALEUR_STYLE_DEFAUT = "text-align: left; font-size: 12px; font-weight: normal; line-height: 14px; float: none; display:block; color: #000; background-color: #fff; font-family: Courier New, courier,fixed;";
|
||||
|
||||
private $style;
|
||||
private $style;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
public function configurer()
|
||||
{
|
||||
$this->style = $this->get_config(self::VAR_STYLE);
|
||||
}
|
||||
|
||||
public function get_titre()
|
||||
{
|
||||
return "Affichage direct dans la page, en HTML";
|
||||
}
|
||||
|
||||
public function get_description()
|
||||
{
|
||||
return "Permet d'afficher les logs directement dans la page resultat, avec une mise en forme HTML.";
|
||||
}
|
||||
|
||||
public function get_configs()
|
||||
{
|
||||
return array(
|
||||
new TlogDestinationConfig(
|
||||
self::VAR_STYLE,
|
||||
"Style d'affichage direct dans la page",
|
||||
"Vous pouvez aussi laisser ce champ vide, et créer un style \"tlog-trace\" dans votre feuille de style.",
|
||||
self::VALEUR_STYLE_DEFAUT,
|
||||
TlogDestinationConfig::TYPE_TEXTAREA
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function ecrire(&$res)
|
||||
public function __construct()
|
||||
{
|
||||
$block = sprintf('<pre class="tlog-trace" style="%s">%s</pre>', $this->style, htmlspecialchars(implode("\n", $this->_logs)));
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
$this->inserer_apres_body($res, $block);
|
||||
public function configure()
|
||||
{
|
||||
$this->style = $this->getConfig(self::VAR_STYLE);
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return "Affichage direct dans la page, en HTML";
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return "Permet d'afficher les logs directement dans la page resultat, avec une mise en forme HTML.";
|
||||
}
|
||||
|
||||
public function getConfigs()
|
||||
{
|
||||
return array(
|
||||
new TlogDestinationConfig(
|
||||
self::VAR_STYLE,
|
||||
"Style d'affichage direct dans la page",
|
||||
"Vous pouvez aussi laisser ce champ vide, et créer un style \"tlog-trace\" dans votre feuille de style.",
|
||||
self::VALEUR_STYLE_DEFAUT,
|
||||
TlogDestinationConfig::TYPE_TEXTAREA
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function write(&$res)
|
||||
{
|
||||
$block = sprintf('<pre class="tlog-trace" style="%s">%s</pre>', $this->style, htmlspecialchars(implode("\n", $this->_logs)));
|
||||
|
||||
$this->InsertAfterBody($res, $block);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user