Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、次を使用して単体テストを実行しています: godep go test -v -run TestMyCode,
godep go test -v -run TestMyCode
しかし、テストで情報ログを表示する方法が見つかりませんでした:
glog.V(4).Infof("Adding new pods from source %s : %v", source, update.Pods)
出来ますか?
いくつかのフラグを設定することで、メッセージをコンソールに記録できます。init() 関数で以下のコードを試してください。
flag.Set("alsologtostderr", fmt.Sprintf("%t", true)) var logLevel string flag.StringVar(&logLevel, "logLevel", "4", "test") flag.Lookup("v").Value.Set(logLevel)