mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
Extend LSlog_handler using LSlog_staticLoggerClass
This commit is contained in:
parent
988054bfc5
commit
d0d3e944ed
6 changed files with 11 additions and 9 deletions
|
@ -43,7 +43,7 @@ class LSlog_console extends LSlog_handler {
|
|||
$this -> stdout = fopen('php://stdout', 'w');
|
||||
$this -> stderr = fopen('php://stderr', 'w');
|
||||
if ($this -> enabled)
|
||||
LSlog :: log_trace("$this Enabled", get_class($this));
|
||||
self :: log_trace("$this Enabled", get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ class LSlog_email extends LSlog_handler {
|
|||
parent :: __construct($config);
|
||||
$this -> recipient = self :: getConfig('recipient');
|
||||
if ($this -> enabled)
|
||||
LSlog :: log_trace("$this Enabled", get_class($this));
|
||||
self :: log_trace("$this Enabled", get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,7 +44,7 @@ class LSlog_file extends LSlog_handler {
|
|||
if (substr($this -> path, 0, 1) != '/')
|
||||
$this -> path = LS_ROOT_DIR."/".$this -> path;
|
||||
if ($this -> enabled)
|
||||
LSlog :: log_trace("$this Enabled", get_class($this));
|
||||
self :: log_trace("$this Enabled", get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,12 +20,14 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
LSsession :: loadLSclass('LSlog_staticLoggerClass');
|
||||
|
||||
/**
|
||||
* Default logging handler
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*/
|
||||
class LSlog_handler {
|
||||
class LSlog_handler extends LSlog_staticLoggerClass {
|
||||
|
||||
// The handler configuration
|
||||
protected $config;
|
||||
|
@ -110,7 +112,7 @@ class LSlog_handler {
|
|||
return $format;
|
||||
}
|
||||
// Unknown key, log warning
|
||||
LSlog :: log_warning("$this -> __get($key): invalid property requested\n".LSlog :: get_debug_backtrace_context());
|
||||
self :: log_warning("__get($key): invalid property requested\n".LSlog :: get_debug_backtrace_context());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,10 +153,10 @@ class LSlog_handler {
|
|||
**/
|
||||
public function setLevel($level) {
|
||||
if (!is_null($level) && !LSlog :: checkLevelExists($level)) {
|
||||
LSlog :: error("Invalid log level '$level'");
|
||||
self :: log_error("Invalid log level '$level'");
|
||||
return false;
|
||||
}
|
||||
LSlog :: debug("Log handler ".get_called_class()." level set to ".(is_null($level)?'default':$level));
|
||||
self :: log_debug("Log handler ".get_called_class()." level set to ".(is_null($level)?'default':$level));
|
||||
$this -> level = $level;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class LSlog_syslog extends LSlog_handler {
|
|||
parent :: __construct($config);
|
||||
$this -> priority = static :: getConfig('priority');
|
||||
if ($this -> enabled)
|
||||
LSlog :: log_trace("$this Enabled", get_class($this));
|
||||
self :: log_trace("$this Enabled", get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,7 +40,7 @@ class LSlog_system extends LSlog_handler {
|
|||
public function __construct($config) {
|
||||
parent :: __construct($config);
|
||||
if ($this -> enabled)
|
||||
LSlog :: log_trace("$this Enabled", get_class($this));
|
||||
self :: log_trace("$this Enabled", get_class($this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue