Re: [whatwg/fetch] String representations for Fetch API objects (Issue #1575)

Console-wise, this is a tough one! The spec is quite vague to allow for implementation-specific formatting that is judged to be "maximally useful". Under https://console.spec.whatwg.org/#printer, see https://console.spec.whatwg.org/#generic-javascript-object-formatting and https://console.spec.whatwg.org/#optimally-useful-formatting.

So aside from filing bugs on implementations requesting a _more useful_ custom visual representation of complicated objects, the only other alternative I can imagine is some sort of hook that console could provide to let complicated objects bypass those definitions and provide their own representation composed of primitives. Perhaps something like allowing objects to supply their own "console string builder" or "console object builder" etc., that the Console Standard can hook into and print the result of, instead of applying the vague definitions that I linked to above. That probably wouldn't be too hard to do and may well have the desired results you're looking for.

Feel free to file a bug on Console for this, but I will say that standard doesn't get a whole lot of love these days so any large contributions are more likely to materialize with help from the community!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1575#issuecomment-1399748194
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1575/1399748194@github.com>

Received on Monday, 23 January 2023 03:28:18 UTC