I have some heavily instrumented code that makes use of the log
package. Now it's come time to turn off the logging, and I can't determine how to turn off the standard logger.
Have I missed something? Should I be checking a flag before making log calls, or commenting them out in production?
No reason to create your own type for a common io.Writer when one exists in the io/ioutil package.
import (
"log"
"io/ioutil"
)
func init() {
log.SetOutput(ioutil.Discard)
}