The zero-valued logging.Logging
struct functions as a no-op logger that does not output anything.
package mypackage
import (
"github.com/qmsk/go-logging"
)
var log logging.Logging
func SetLogging(l logging.Logging) {
log = l
}
import (
"github.com/qmsk/go-logging"
"flag"
".../mypackage"
)
var LoggingOptions logging.Options
func init() {
LoggingOptions.InitFlags()
}
func main() {
flag.Parse()
mypackage.SetLogging(LoggingOptions.MakeLogging())
...
}