Browse Source

Fix notices when logging from outside a class

tags/0.6
Chris Smith 14 years ago
parent
commit
05dd86e663
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      logging.inc.php

+ 4
- 1
logging.inc.php View File

@@ -48,7 +48,10 @@ class Logger {
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']), $traces[1]['line'], $trace['class'], $trace['type'], $trace['function'], implode(', ', $trace['args']));
51
+  $class = isset($trace['class']) ? $trace['class'] : '';
52
+  $type = isset($trace['type']) ? $trace['type'] : '';
53
+
54
+  return sprintf('%s:%s %s%s%s(%s)', basename($trace['file']), $traces[1]['line'], $class, $type, $trace['function'], implode(', ', $trace['args']));
52 55
  }
53 56
 
54 57
  protected static function formatArg(&$value, $key) {

Loading…
Cancel
Save