aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-04 23:13:46 -0700
committerfriendica <info@friendica.com>2014-09-04 23:13:46 -0700
commit01a5ac92a8363285f84689274ade0dbda30e5a41 (patch)
tree5a1ab4b62827885a0bae096276cbcffc5507098f
parent4875473c1bf375cf280118b7e5b2eb80e55b8843 (diff)
downloadvolse-hubzilla-01a5ac92a8363285f84689274ade0dbda30e5a41.tar.gz
volse-hubzilla-01a5ac92a8363285f84689274ade0dbda30e5a41.tar.bz2
volse-hubzilla-01a5ac92a8363285f84689274ade0dbda30e5a41.zip
improved logging if you're using php54 or later
-rw-r--r--include/text.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index 7da6a8f2b..50c68b6b2 100644
--- a/include/text.php
+++ b/include/text.php
@@ -508,8 +508,14 @@ function logger($msg,$level = 0) {
if((! $debugging) || (! $logfile) || ($level > $loglevel))
return;
-
- @file_put_contents($logfile, datetime_convert() . ':' . session_id() . ' ' . $msg . "\n", FILE_APPEND);
+
+ $where = '';
+ if(version_compare(PHP_VERSION,'5.4.0') >= 0) {
+ $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
+ $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': ';
+ }
+
+ @file_put_contents($logfile, datetime_convert() . ':' . session_id() . ' ' . $where . $msg . "\n", FILE_APPEND);
return;
}