Sometimes I fall in love with code
I don’t use this, since I need often more but isn’t this just need?
http://play.golang.org/p/QFheQeChIn
package main
import "log"
const debug debugging = true // or flip to false
type debugging bool
func (d debugging) Printf(format string, args ...interface{}) {
d {
log.Printf(format, args...)
}
}
func main() {
debug.Printf("foo %d %.2f", 42, 12.7)
}