Initial commit

This commit is contained in:
微凉
2020-12-24 01:39:45 +08:00
commit 430b4cf723
30 changed files with 1223 additions and 0 deletions

21
bootstrap/log.go Normal file
View File

@@ -0,0 +1,21 @@
package bootstrap
import (
"github.com/Xhofe/alist/conf"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
func InitLog() {
if conf.Debug {
log.SetLevel(log.DebugLevel)
}else {
gin.SetMode(gin.ReleaseMode)
}
log.SetFormatter(&log.TextFormatter{
ForceColors:true,
EnvironmentOverrideColors:true,
TimestampFormat:"2006-01-02 15:04:05",
FullTimestamp:true,
})
}