func EnableStructuredLogs(logDebugStdout, verbose bool) (func(), error) {
	highPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {
		return lvl >= zapcore.ErrorLevel
	})
	lowPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {
		return lvl < zapcore.ErrorLevel
	})
	consoleErrors := zapcore.Lock(os.Stderr)
	consoleDebugging := consoleErrors
	if logDebugStdout {
		consoleDebugging = zapcore.Lock(os.Stdout)
	}
	config := zap.NewProductionEncoderConfig()
	config.LevelKey = "severity"
	config.MessageKey = "message"
	config.TimeKey = "timestamp"
	config.EncodeLevel = zapcore.CapitalLevelEncoder
	config.EncodeTime = zapcore.ISO8601TimeEncoder
	consoleEncoder := zapcore.NewJSONEncoder(config)
	core := zapcore.NewTee(
		zapcore.NewCore(consoleEncoder, consoleErrors, highPriority),
		zapcore.NewCore(consoleEncoder, consoleDebugging, lowPriority),
	)
	logger := zap.New(core, zap.AddCaller(), zap.AddStacktrace(zapcore.ErrorLevel))
	sugar := logger.Sugar()
	Verbosef = sugar.Infof
	if !verbose {
		Verbosef = noop
	}
	Infof = sugar.Infof
	Errorf = sugar.Errorf
	return func() {
		logger.Sync()
	}, nil
}
EnableStructuredLogs replaces all logging functions with structured logging
variants.
package logging
import (
	"log"
	"os"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)
var Verbosef = log.Printf
var Infof = log.Printf
var Errorf = log.Printf
func LogDebugToStdout() {
	logger := log.New(os.Stdout, "", log.LstdFlags)
	Verbosef = logger.Printf
	Infof = logger.Printf
}
func noop(string, ...interface{}) {}
func LogVerboseToNowhere() {
	Verbosef = noop
}
func DisableLogging() {
	Verbosef = noop
	Infof = noop
	Errorf = noop
}