I want to create a new function that doing print, only if Debug=True
. This how I'm doing it in JavaScript:
function log(...args) {
if (debug) console.log.apply(null,args)
}
or
function log() {
if (debug) console.log.apply(null,arguments)
}
How I can do similar things in Python?
The question: How to pass all the arguments I'm getting in Python?