Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating the logging code to not throw away all class information (#1493
) * Updating the logging code to not throw away all class information We ran into a problem described in this PR: #1490 After some research I found that the root of the problem is this function json_encode'ing `$record` when the contents of `$record` may contain objects that do not support `JsonSerializable` but that do implement `toString()`. After a conversation w/ Joe it's been decided that our Logging API will be to support the logging of arrays w/ objects that implement a `toString()` function. The eagle-eyed may notice that this solution differs from the one I put forth in the above PR. The reason being that the original solution only supported the use case of having an array w/ top level value objects and would not work as expected if a nested array is supplied with an object that implements `toString()`. * Adding Additional Documentation Per @jpwhite4, it's important that we document that our Logger supports logging both strings and arrays, and if an array is provided that contains objects, those objects will be converted to strings via the `__toString` function. Co-authored-by: Ryan Rathsam <build@shippable.com>
- Loading branch information