1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 05:07:36 +02:00

Avoid failures when normalizing exotic values, fixes #89

This commit is contained in:
Jordi Boggiano
2012-06-15 16:45:18 +02:00
parent da33c84d07
commit 4829b09743

View File

@@ -70,11 +70,15 @@ class NormalizerFormatter implements FormatterInterface
return $data->format($this->dateFormat);
}
if (is_object($data)) {
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data));
}
if (is_resource($data)) {
return '[resource]';
}
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data));
return '[unknown('.gettype($data).')]';
}
protected function toJson($data)