P5.js-web-editor: Add logging with winston

Created on 1 Mar 2019  路  11Comments  路  Source: processing/p5.js-web-editor

I think we should remove console.logs from the code

Links :- https://dev.to/mornir/-dont-leave-console-logs-in-production-14na
https://hackernoon.com/please-stop-using-console-log-its-broken-b5d7d396cf15

I can send in a PR

Have a look @catarak

good first issue help wanted high task

All 11 comments

totally! it would be amazing to add a logging library. maybe this ticket could be that鈥攊nvestigate and add logging library?

Yeah , I will look into it and start refactoring

As I was looking through the code , I found out that most of the console statements were used for debugging and some for handling errors.
There are 2 ways to solve this.

  1. Remove console.logs used for debugging
    2.find a way to disable console.logs on the prod mode and enable in dev mode which agains boils down to adding a logging library

sounds great to me!

@catarak I was thinking of a solution to this ticket.
Should I monkey patch window.console.log which checks if we are in dev mode or prod mode and logs only in dev mode?

process.env.NODE_ENV is already passed to the front end (e.g. in App.jsx), so removing console logs when in prod should be pretty simple!

@siddhant1 Could I please work on this issue while you're working on the other ones? Thank you!

Hey Gaurang , this issue was already solved and needs to be closed. You can work on other ones :)

@siddhant1 / @GaurangTandon this issue hasn't been solved. no logging library has been added.

The issue was originally to remove logs which was done , for adding logging library , I will send a pr soon

I am working on this

Was this page helpful?
0 / 5 - 0 ratings