-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pretty print console logs #443
Comments
Thanks for filing this feature request! I'm really not sure if this is more readable than running logs through Prettier or We could have this formatting for cc @cpojer |
@thymikee I did not think of using Prettier. I looked around the JS ecosystem again and found pretty-format which is what Jest uses for snapshot tests: https://github.com/facebook/jest/tree/master/packages/pretty-format. As for using util.format; I think it would be more difficult to read deeply nested objects then the pseudo console.table output I defined above. But I have no evidence to back up that claim. 🤷♀ |
Logs are controlled by Metro. Please check if this is still an issue and if it is, file it there: https://github.com/facebook/metro |
Describe the Feature
Now that console.log is forwarded to the CLI, we should think about formatting those logs to be easily readable in the terminal.
Possible Implementations
Here is an idea of displaying arrays and objects to the console using some basic ASCII graphics. (The format below is loosely based upon console.table and csvkit.)
I tried to make to design this formatting style with nesting in mind, as it is very common to nest JS objects.
Related Issues
Log
console
invocations to the terminalThe text was updated successfully, but these errors were encountered: