mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-22 12:58:45 +08:00
feat: show gorm log on debug/dev mode (#2720)
This commit is contained in:
parent
e58ca686e3
commit
5a6b600ace
@ -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,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user