I have tried using Winston for logging my API, which I'm using by overriding console.log like this:console.error = function() {return logger.error(...arguments);};Which does seem to work fine on development, but once I get it out to production, the messages I'm getting have some sort of escaped text, and it doesn't specify which line of which file the error occurred in. It does show the line of the bundled JS file though. Is there any way to get the real file/line of the error in a human readable format? Any help would be appreciated.Example error:{"message":" \u001b[0m\u001b[97m\u001b[41mTypeError\u001b[0m\u001b[90m:\u001b[0m\u001b[37m \u001b[0m\u001b[97mCannot read property 'includes' of undefined\u001b[0m\n\u001b[0m \u001b[0m\n\u001b[0m \u001b[0m\u001b[90m-\u001b[0m \u001b[0m\u001b[93mserver.js\u001b[0m\u001b[90m:\u001b[0m\u001b[93m1\u001b[0m\u001b[37m \u001b[0m\n\u001b[0m \u001b[0m \u001b[0m\u001b[90m/app/build/server.js:1:137653\u001b[0m\n\u001b[0m \u001b[0m\n\u001b[0m","level":"error","timestamp":"2020-01-15 11:26:39"}
Submitted January 15, 2020 at 11:50AM by biohazard19
No comments:
Post a Comment