【优化】租户功能,框架优化

This commit is contained in:
PandaGoAdmin
2022-07-18 18:17:11 +08:00
parent d33bd39570
commit ae38e7bcef
60 changed files with 861 additions and 647 deletions

View File

@@ -4,24 +4,21 @@ import (
"fmt"
"os"
"pandax/base/config"
"pandax/base/global"
"strings"
"time"
"github.com/sirupsen/logrus"
)
var Log = logrus.New()
func init() {
func InitLog(logConf *config.Log) *logrus.Logger {
var Log = logrus.New()
Log.SetFormatter(new(LogFormatter))
Log.SetReportCaller(true)
logConf := config.Conf.Log
// 如果不存在日志配置信息则默认debug级别
if logConf == nil {
Log.SetLevel(logrus.DebugLevel)
return
return nil
}
// 根据配置文件设置日志级别
@@ -44,8 +41,7 @@ func init() {
Log.Out = file
}
global.Log = Log
return Log
}
type LogFormatter struct{}