2016-06-13 2 views

답변

1

몇 개의 플래그를 설정하여 메시지를 콘솔에 기록 할 수 있습니다. init() 함수에서 아래 코드를 시도하십시오.

flag.Set("alsologtostderr", fmt.Sprintf("%t", true)) 
var logLevel string 
flag.StringVar(&logLevel, "logLevel", "4", "test") 
flag.Lookup("v").Value.Set(logLevel) 
관련 문제