Disable gorm log.
This commit is contained in:
parent
a5ddc56b7d
commit
51c6ee46c1
@ -24,6 +24,9 @@ var defaultLogger = Logger{log.New(os.Stdout, "\r\n", 0)}
|
||||
var sqlRegexp = regexp.MustCompile(`(\$\d+)|\?`)
|
||||
|
||||
func (logger Logger) Print(values ...interface{}) {
|
||||
|
||||
if gormLog := os.Getenv("GORM_LOG_ON"); gormLog != "" {
|
||||
|
||||
if len(values) > 1 {
|
||||
level := values[0]
|
||||
currentTime := "\n\033[33m[" + NowFunc().Format("2006-01-02 15:04:05") + "]\033[0m"
|
||||
@ -65,3 +68,4 @@ func (logger Logger) Print(values ...interface{}) {
|
||||
logger.Println(messages...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user