logger : remove a Strict Standard warning

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1957 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-01-29 11:59:21 +00:00
parent b152996eab
commit 62b2878476

View File

@@ -18,7 +18,7 @@ class logger
// TODO : Add SQL support
/** The method to log.
Can be display, file, syslog
Can be merged with a pipe : "display|syslog"*/
Can be merged with a pipe : "display|syslog|file"*/
public $logtype = "display";
/** For logtype=file, the filename to use */
public $logfile = FALSE;
@@ -57,7 +57,8 @@ class logger
{
if ($this->loglevelmin < $priority)
return;
$back = reset (debug_backtrace());
$backtrace = debug_backtrace();
$back = reset ($backtrace);
$message .= " [".basename ($back["file"]).":".$back["line"]."]";
$logsType = explode ("|", $this->logtype);
if (in_array ("display", $logsType))
@@ -84,8 +85,7 @@ class logger
throw new Exception ("The directory ".dirname ($this->logfile)." must"
." be writable to create log file");
}
if (!is_writable ($this->logfile))
elseif (!is_writable ($this->logfile))
{
if (function_exists ("posix_geteuid"))
$user = posix_geteuid ();