Browse Source

Fix logger showing line numbers of methods not log calls

tags/0.6
Chris Smith 14 years ago
parent
commit
2c69d24462
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      logging.inc.php

+ 3
- 3
logging.inc.php View File

@@ -43,12 +43,12 @@ class Logger {
43 43
  }
44 44
 
45 45
  protected static function getCaller() {
46
-  $trace = debug_backtrace(); // First two will be log and getCaller
47
-  $trace = $trace[2];
46
+  $traces = debug_backtrace(); // First one will be getCaller, next Log::logger
47
+  $trace = $traces[2];
48 48
 
49 49
   array_walk($trace['args'], array('Logger', 'formatArg'));
50 50
 
51
-  return sprintf('%s:%s %s%s%s(%s)', basename($trace['file']), $trace['line'], $trace['class'], $trace['type'], $trace['function'], implode(', ', $trace['args']));
51
+  return sprintf('%s:%s %s%s%s(%s)', basename($trace['file']), $traces[1]['line'], $trace['class'], $trace['type'], $trace['function'], implode(', ', $trace['args']));
52 52
  }
53 53
 
54 54
  protected static function formatArg(&$value, $key) {

Loading…
Cancel
Save