better logging / debug output
is there a way to view better debug output?
ie formatted json objects?
It gets really hard having to manually decode the output I see like:
5 Replies
I'd try using
JSON.stringify
with a spacer parameter on your objects in your console.log
statement: console.log(JSON.stringify({ x: 5, y: 6 }, null, 2));
See reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
If that doesn't work, let us know, it might be something we'd have to improve on our end. Also, check if the logs screen in the convex dashboard seems any better.JSON.stringify() - JavaScript | MDN
The JSON.stringify() static method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
@DCsan Are you reading these logs in the browser console or on the Convex dashboard?
browser console
a bit less ugly in the dashboard
stringify in the console just gives me output with lots of
\n
in it
in the dash also:
(any reason image posts are disabled here?)oof sorry about that
@ballingt any ideas? I'll put this on our list internally to improve either way.
We can start rendering those newlines properly! It's on a list, hearing from you helps prioritize@DCsan.