summaryrefslogtreecommitdiff
path: root/internal/toggledlog/log.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-02-07 10:55:13 +0100
committerJakob Unterwurzacher2016-02-07 10:55:13 +0100
commit3a4922b5d747d54c9cb62833c9d69acb96b072f6 (patch)
tree39eea52028ea5a60f1e0cce47be79a88f0a8169e /internal/toggledlog/log.go
parente111e20649cfacd7b02dd454d75db879aa2ca53c (diff)
Add tests for long name creation and renaming (currently failing, obviously)
Diffstat (limited to 'internal/toggledlog/log.go')
-rw-r--r--internal/toggledlog/log.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/toggledlog/log.go b/internal/toggledlog/log.go
index 4a2ad03..5e5191a 100644
--- a/internal/toggledlog/log.go
+++ b/internal/toggledlog/log.go
@@ -25,7 +25,7 @@ type toggledLogger struct {
// Enable or disable output
Enabled bool
// Panic after logging a message, useful in regression tests
- PanicAfter bool
+ Wpanic bool
*log.Logger
}
@@ -34,8 +34,8 @@ func (l *toggledLogger) Printf(format string, v ...interface{}) {
return
}
l.Logger.Printf(format, v...)
- if l.PanicAfter {
- panic("PanicAfter: " + fmt.Sprintf(format, v...))
+ if l.Wpanic {
+ panic("-wpanic turns warning into panic: " + fmt.Sprintf(format, v...))
}
}
func (l *toggledLogger) Println(v ...interface{}) {
@@ -43,8 +43,8 @@ func (l *toggledLogger) Println(v ...interface{}) {
return
}
l.Logger.Println(v...)
- if l.PanicAfter {
- panic("PanicAfter: " + fmt.Sprintln(v...))
+ if l.Wpanic {
+ panic("-wpanic turns warning into panic: " + fmt.Sprintln(v...))
}
}