mirror of
https://github.com/AlistGo/alist.git
synced 2025-07-12 19:39:10 +08:00
feat: show gorm log on debug/dev mode (#2720)
This commit is contained in:
@ -19,11 +19,15 @@ import (
|
||||
)
|
||||
|
||||
func InitDB() {
|
||||
logLevel := logger.Silent
|
||||
if flags.Debug || flags.Dev {
|
||||
logLevel = logger.Info
|
||||
}
|
||||
newLogger := logger.New(
|
||||
stdlog.New(log.StandardLogger().Out, "\r\n", stdlog.LstdFlags),
|
||||
logger.Config{
|
||||
SlowThreshold: time.Second,
|
||||
LogLevel: logger.Silent,
|
||||
LogLevel: logLevel,
|
||||
IgnoreRecordNotFoundError: true,
|
||||
Colorful: true,
|
||||
},
|
||||
|
Reference in New Issue
Block a user