disco
disco copied to clipboard
console.log only when in dev mode
Using console.log can be very slow (similar to how print() in python or other languages console output can create a big overhead). This is important only in the training_manager as there are a lot of console.log. We should do something like:
if (dev mode) console.log('some info')
still an issue now? @s314cy i think you and @tharvik did mention it sometime
I think nacho was referring to the calls to console.{log,warn,error}
within the web client.
In my view, console prints are necessary in case of an error. This allows the user to receive visual feedback in the client's UI together with a more detailed error in the console, if they're willing to look for it and potentially report it to us. So we should keep them here.
On the other hand, console.log
calls should not appear in production code. Right now, most of those calls were removed for the sake of production-readiness. However, it would certainly be useful to have them in the dev environment. Thus I would not consider this issue as closed, but it's definitely not urgent. It can wait for another similar issue to appear and be solved together.