logger : allow to remove more entries in the dump stack to find the right file calling the logger

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1964 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-01-29 13:20:10 +00:00
parent 751a48c8d9
commit 271356d506

View File

@@ -31,6 +31,9 @@ class logger
public $syslogFacility = LOG_USER;
/** In Syslog, prefix the log by the text */
public $syslogPrefix = FALSE;
/** Remove X entries of backtrace to see the right file generating the error
*/
public $backTraceSkip = 0;
/** The priorities which can be used in the priorities
LOG_EMERG system is unusable
@@ -60,7 +63,8 @@ class logger
if ($this->loglevelmin < $priority)
return;
$backtrace = debug_backtrace();
$back = reset ($backtrace);
for ($i = 0 ; $i <= $this->backTraceSkip ; $i++)
$back = array_shift ($backtrace);
$msg = "";
if (isset ($_SERVER["REMOTE_ADDR"]))
{