예제 #1
0
func (c *bootContext) setLogVerbose(verbose int) {
	if c.vFlag >= 0 {
		log.SetLogVerbose(c.vFlag)
	} else {
		log.SetLogVerbose(verbose)
	}
}
예제 #2
0
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	flag.Int("vv", 0, "vv")
	var fs = flag.NewFlagSet("deblocus", flag.ErrorHandling(0xffff))
	var null, _ = os.Open(os.DevNull)
	defer null.Close()
	fs.SetOutput(null)
	var v int
	fs.IntVar(&v, "vv", 0, "log verbose")
	var deblocusArgs []string
	deblocusArgs = append(deblocusArgs, os.Args[1:]...)
	fs.Parse(deblocusArgs)

	log.SetLogOutput("")
	log.SetLogVerbose(v)
	cltAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	svrAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	dstAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	fmt.Println("=== deblocus TEST ===")
	printArgLine("logV", v)
	printArgLine("cltAddr", cltAddr)
	printArgLine("svrAddr", svrAddr)
	printArgLine("dstAddr", dstAddr)
	fmt.Println("\n")
}
예제 #3
0
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	v := initAddonArgs(0)
	log.SetLogOutput("")
	log.SetLogVerbose(v)
	cltAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	svrAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	dstAddr += strconv.FormatInt(randomRange(1, 1<<13)+3e4, 10)
	fmt.Println("=== deblocus TEST ===")
	printArgLine("logV", v)
	printArgLine("cltAddr", cltAddr)
	printArgLine("svrAddr", svrAddr)
	printArgLine("dstAddr", dstAddr)
	fmt.Println("\n")
}