Exemplo n.º 1
0
func main() {
	// in response to some conditional
	log = dog.NewDog(dog.WARN)

	log.Warn = dog.CreateLog(dog.FgRed, "> ")
	log.Warn("Typical customization")

	log.Warn = dog.CreateLog("", dog.FgRed+">"+dog.TR+" ")
	log.Warn("Even more minimal")

	log.Warn = dog.CreateLog(dog.FgYellow+dog.Reverse, "🐺  ")
	log.Warn("Dawg, this custom log format is rockin the CLI!!1")
}
Exemplo n.º 2
0
func TestMain(m *testing.M) {
	announceTest = dog.CreateLog(dog.FgYellow, "")
	flag.Parse()

	// essential setup commands
	runtime.GOMAXPROCS(runtime.NumCPU())
	*shell = "/bin/sh"

	ManageStdin()

	os.Exit(m.Run())
}