Currently I'm having a lot of console.log in my modules. Many of them are debug-messages, which I only need to see, if I'm debugging my application.
I would like to enable debugging using a parameter when starting up my application, for instance node myApp.js -d. Further my module should then only call the console.log if debugging is active.
What is best practice in Node to accomplish this?