Commit e7c3cb22 authored by Tim Hockin's avatar Tim Hockin

Logf() failures for nicer logs

parent ca30f386
...@@ -252,16 +252,24 @@ func nowStamp() string { ...@@ -252,16 +252,24 @@ func nowStamp() string {
return time.Now().Format(time.StampMilli) return time.Now().Format(time.StampMilli)
} }
func Logf(format string, a ...interface{}) { func logf(level string, format string, args ...interface{}) {
fmt.Fprintf(GinkgoWriter, nowStamp()+": INFO: "+format+"\n", a...) fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
} }
func Failf(format string, a ...interface{}) { func Logf(format string, args ...interface{}) {
Fail(nowStamp()+": "+fmt.Sprintf(format, a...), 1) logf("INFO", format, args...)
}
func Failf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
logf("FAIL", msg)
Fail(nowStamp()+": "+msg, 1)
} }
func Skipf(format string, args ...interface{}) { func Skipf(format string, args ...interface{}) {
Skip(nowStamp() + ": " + fmt.Sprintf(format, args...)) msg := fmt.Sprintf(format, args...)
logf("SKIP", msg)
Skip(nowStamp() + ": " + msg)
} }
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) { func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment