mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 05:36:45 +02:00
Avoid failures when normalizing exotic values, fixes #89
This commit is contained in:
@@ -70,11 +70,15 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
return $data->format($this->dateFormat);
|
return $data->format($this->dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_object($data)) {
|
||||||
|
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data));
|
||||||
|
}
|
||||||
|
|
||||||
if (is_resource($data)) {
|
if (is_resource($data)) {
|
||||||
return '[resource]';
|
return '[resource]';
|
||||||
}
|
}
|
||||||
|
|
||||||
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data));
|
return '[unknown('.gettype($data).')]';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function toJson($data)
|
protected function toJson($data)
|
||||||
|
Reference in New Issue
Block a user