Hi I am running my unit tests by using:
godep go test -v -run TestMyCode
,
but I did not find a way to show my info logs in my tests:
glog.V(4).Infof("Adding new pods from source %s : %v", source, update.Pods)
Is it possible?
You can log your messages to console by setting few flags. Try the below code in the init() function.
flag.Set("alsologtostderr", fmt.Sprintf("%t", true))
var logLevel string
flag.StringVar(&logLevel, "logLevel", "4", "test")
flag.Lookup("v").Value.Set(logLevel)