vikunja-api/vendor/github.com/swaggo/swag/debug.go

31 lines
468 B
Go
Raw Normal View History

2019-05-07 21:42:24 +02:00
package swag
import (
"log"
)
const (
test = iota
release
)
var swagMode = release
func isRelease() bool {
return swagMode == release
}
2019-10-16 22:52:29 +02:00
// Println calls Output to print to the standard logger when release mode.
2019-05-07 21:42:24 +02:00
func Println(v ...interface{}) {
if isRelease() {
log.Println(v...)
}
}
2019-10-16 22:52:29 +02:00
// Printf calls Output to print to the standard logger when release mode.
2019-05-07 21:42:24 +02:00
func Printf(format string, v ...interface{}) {
if isRelease() {
log.Printf(format, v...)
}
}