Closed ironng closed 4 years ago
Wasn't sure if the json file is fine as is - is it preferable to keep all the logs to have a better story of what happened, or should we filter to only capture the error logs? Also, any opinions on formatting it more like a typical log file instead of a json?
NB: there are still some errors that don't even make it to the sagas from tbtc.js, we might have to poke around to add some catch clauses to promises there.
@Shadowfiend I'd like to tackle #272 separately - there are a few other mobile widths issues I've seen that I'd like to tackle, and it'd be a good opportunity to just take a pass at all the screens at the same time.
Ok sounds good! Will merge here shortly in that case :)
Uses console.history to build a log history that we can export as a json (the browser does not store the console history natively). Refactors the footer css a little to get the download button placement correct. Also adds a helper method
logError
to the sagas to both dispatch the error action and log the error to the console. A newonError
hook to the saga middleware logs any error not caught in the sagas. There are also some other improvements - a newDescription
component to display the step description or error and fixes a couple lot size UI related nits.Screenshots
![FireShot Capture 081 - tBTC - localhost](https://user-images.githubusercontent.com/1986137/88347550-cf029080-ccff-11ea-9e3a-b422aa197e1c.png) Hover ![Screen Shot 2020-07-23 at 4 06 51 PM](https://user-images.githubusercontent.com/1986137/88347574-dcb81600-ccff-11ea-9a28-87fb69b89e74.png) Click ![Screen Shot 2020-07-23 at 4 07 20 PM](https://user-images.githubusercontent.com/1986137/88347577-de81d980-ccff-11ea-85d6-ac2f4a8caf04.png)Sample json log
```json { "type": "warn", "timestamp": "Fri, 24 Jul 2020 00:09:45 GMT", "arguments": { "0": "../tbtc.js/node_modules/bcrypto/lib/node/bn.js 47:17\nModule parse failed: Identifier directly after number (47:17)\nYou may need an appropriate loader to handle this file type.\n| \n| \n> const U8_MAX = (1n << 8n) - 1n;\n| const U16_MAX = (1n << 16n) - 1n;\n| const U32_MAX = (1n << 32n) - 1n;" }, "stack": [ "at printWarnings (http://localhost:3000/static/js/0.chunk.js:265937:17)", "at handleWarnings (http://localhost:3000/static/js/0.chunk.js:265942:3)", "at SockJS.push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage (http://localhost:3000/static/js/0.chunk.js:266007:7)", "at SockJS.push../node_modules/sockjs-client/lib/event/eventtarget.js.EventTarget.dispatchEvent (http://localhost:3000/static/js/0.chunk.js:305789:20)", "at http://localhost:3000/static/js/0.chunk.js:306591:16", "at Array.forEach (Closes #257