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