I'm printing JSON data that spans multiple lines to the console. I'm prefixing all my messages with a tag and then filtering by that tag to keep things relevant. So my messages look like this with no filter:
TAG: {
"key1": "value1",
"key2": "value2",
...
}
When I filter by TAG, I only see the first line because as far as I can tell, Xcode is just checking line by line instead checking by message.
TAG: {
How can I make Xcode output all the lines in the JSON? Is there a better way than writing my own print function that splits by \n and prefixes each line with TAG? This might not even work because the values might have a \n internally.
You can use .description property while printing.
Here is an example
print(yourObject.description)
It prints everything in one line and while doing a filter, you will be able to see everything.
This worked for me. Hope this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With