Have you heard of closures?
log = buildLog(debug)
...
log("Something ya wanna log")
Now you can control logging globally or your can control it locally by only passing the enabled log function to the few things that need it right now. This little scheme combines well with default arguments.