func Example() {
	setup()
	debug := flag.Bool("debug", false, "sets log level to debug")
	flag.Parse()
	zerolog.SetGlobalLevel(zerolog.InfoLevel)
	if *debug {
		zerolog.SetGlobalLevel(zerolog.DebugLevel)
	}
	log.Debug().Msg("This message appears only when log level set to Debug")
	log.Info().Msg("This message appears when log level set to Debug or Info")
	if e := log.Debug(); e.Enabled() {
		value := "bar"
		e.Str("foo", value).Msg("some debug message")
	}
}
TODO: Panic
This example uses command-line flags to demonstrate various outputs
depending on the chosen log level.
package log_test
import (
	"errors"
	"flag"
	"os"
	"time"
	"github.com/didi/gatekeeper/golang_common/zerolog"
	"github.com/didi/gatekeeper/golang_common/zerolog/log"
)
func setup() {
	zerolog.TimeFieldFormat = ""
	zerolog.TimestampFunc = func() time.Time {
		return time.Date(2008, 1, 8, 17, 5, 05, 0, time.UTC)
	}
	log.Logger = zerolog.New(os.Stdout).With().Timestamp().Logger()
}
func ExamplePrint() {
	setup()
	log.Print("hello world")
}
func ExamplePrintf() {
	setup()
	log.Printf("hello %s", "world")
}
func ExampleLog() {
	setup()
	log.Log().Msg("hello world")
}
func ExampleDebug() {
	setup()
	log.Debug().Msg("hello world")
}
func ExampleInfo() {
	setup()
	log.Info().Msg("hello world")
}
func ExampleWarn() {
	setup()
	log.Warn().Msg("hello world")
}
func ExampleError() {
	setup()
	log.Error().Msg("hello world")
}
func ExampleFatal() {
	setup()
	err := errors.New("A repo man spends his life getting into tense situations")
	service := "myservice"
	log.Fatal().
		Err(err).
		Str("service", service).
		Msgf("Cannot start %s", service)
}