mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
29 lines
407 B
Go
29 lines
407 B
Go
package debug
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var logger = log.New(os.Stderr, "[debug]", log.Lshortfile)
|
|
|
|
func Print(v ...interface{}) {
|
|
if viper.GetBool("debug") {
|
|
log.Print(v...)
|
|
}
|
|
}
|
|
|
|
func Printf(format string, v ...interface{}) {
|
|
if viper.GetBool("debug") {
|
|
log.Printf(format, v...)
|
|
}
|
|
}
|
|
|
|
func Println(v ...interface{}) {
|
|
if viper.GetBool("debug") {
|
|
log.Println(v...)
|
|
}
|
|
}
|