alist/bootstrap/log.go

21 lines
437 B
Go
Raw Normal View History

2021-10-27 14:45:36 +00:00
package bootstrap
import (
"github.com/Xhofe/alist/conf"
log "github.com/sirupsen/logrus"
)
// initLog init log
func InitLog() {
if conf.Debug {
log.SetLevel(log.DebugLevel)
log.SetReportCaller(true)
}
log.SetFormatter(&log.TextFormatter{
//DisableColors: true,
ForceColors: true,
EnvironmentOverrideColors: true,
TimestampFormat: "2006-01-02 15:04:05",
FullTimestamp: true,
})
}