XRPL-Labs / xapp-builder

MIT License
2 stars 0 forks source link

Relayed console messages from inside app formatting #10

Closed WietseWind closed 1 year ago

WietseWind commented 1 year ago

Currently console logs from the inner app look like this:

image

Remove the JSON formatting, keep File & Line No and message, but as string + string + object:

Console message [ https://banxa.xumm.dev/js/app.fab87373.js:1 ]
{the message, can be string, number, object, etc.}
technotip commented 1 year ago

Changed it to:

Screenshot 2023-05-05 at 1 48 48 PM

People are used to looking at the line number at the extreme right(where it says work.js:125). So I am thinking of specifying the line number separately. But for most apps which use reactjs or angular or vue, the Javascript is usually minified, so the line number will always be 1.

Shall I just output the console log without the labels: file, line no and message? And simply output the actual file url +" "+ line no +" "+ message.

WietseWind commented 1 year ago

Yeah let's do that, but then message should only be concatenated if typeof is string, otherwise it should be a second param in the console.log, so it'll show as a real collapsable object if object.

technotip commented 1 year ago
Screenshot 2023-05-05 at 5 01 52 PM Screenshot 2023-05-05 at 5 05 17 PM
WietseWind commented 1 year ago

Perfect :) (Maybe "Line:" in front of the 1 and only add the line if > 1?)

technotip commented 1 year ago

Done. 👍