logger.go 557 字节
package log

import (
	"github.com/linmadan/egglib-go/log/logrus"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"

	"github.com/linmadan/egglib-go/log"
)

var Logger log.Logger

func init() {
	if constant.LOG_FRAMEWORK == "beego" {
		Logger = NewBeegoLog(LoggerConfig{
			Filename: constant.LOG_FILE,
			Level:    7,
			MaxSize:  1024 * 1024 * 2,
		})
	} else if constant.LOG_FRAMEWORK == "logrus" {
		Logger = logrus.NewLogrusLogger()
		Logger.SetServiceName(constant.SERVICE_NAME)
		Logger.SetLevel(constant.LOG_LEVEL)
	}
}