Browse Source

Handle array/object arguments in logging calls

stable
Chris Smith 13 years ago
parent
commit
f2195c74dc
2 changed files with 7 additions and 1 deletions
  1. 1
    1
      discoverer.inc.php
  2. 6
    0
      logging.inc.php

+ 1
- 1
discoverer.inc.php View File

@@ -306,7 +306,7 @@ class Discoverer {
306 306
     if (strpos($m[1], '://') !== false) {
307 307
      // Fully qualified URL
308 308
      $this->claimedId = $m[1];
309
-     Logger::log('Redirection (full qualified) to ' . $m[1]);
309
+     Logger::log('Redirection (fully qualified) to ' . $m[1]);
310 310
     } else if ($m[1][0] == '/') {
311 311
      // Absolute URL
312 312
      $this->claimedId = preg_replace('#^(.*?://.*?)/.*$#', '\1', $this->claimedId) . $m[1];

+ 6
- 0
logging.inc.php View File

@@ -55,6 +55,12 @@ class Logger {
55 55
  }
56 56
 
57 57
  protected static function formatArg(&$value, $key) {
58
+  if (is_array($value)) {
59
+   $value = '[' . implode(',', $value) . ']';
60
+  } else if (is_object($value)) {
61
+   $value = '(object: ' . get_class($value) . ')';
62
+  }
63
+
58 64
   if (strlen($value) > 30 && self::TRUNCATE_ARGS) {
59 65
    $value = substr($value, 0, 27) . '...';
60 66
   }

Loading…
Cancel
Save