mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Merge remote-tracking branch 'draev/patch-1'
This commit is contained in:
@@ -94,7 +94,12 @@ class NormalizerFormatter implements FormatterInterface
|
||||
return $this->normalizeException($data);
|
||||
}
|
||||
|
||||
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data, true));
|
||||
$objData = $this->toJson($data, true);;
|
||||
if(!$objData and method_exists($data, '__toString')) {
|
||||
$objData = $data;
|
||||
}
|
||||
|
||||
return sprintf("[object] (%s: %s)", get_class($data), $objData);
|
||||
}
|
||||
|
||||
if (is_resource($data)) {
|
||||
|
@@ -207,7 +207,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
|
||||
$pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: \)"%';
|
||||
$pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: BAR - test_resource\)"%';
|
||||
} else {
|
||||
$pattern = '%\\\\"resource\\\\":null%';
|
||||
}
|
||||
|
Reference in New Issue
Block a user