logger.go
560 字节
package log
import (
"github.com/linmadan/egglib-go/log"
"github.com/linmadan/egglib-go/log/logrus"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
)
var Logger log.Logger
func init() {
if constant.LOG_FRAMEWORK == "beego" {
Logger = NewBeegoLog(LoggerConfig{
Filename: constant.LOG_FILE,
Level: 7,
MaxSize: 1024 * 1024 * 6,
})
} else if constant.LOG_FRAMEWORK == "logrus" {
Logger = logrus.NewLogrusLogger()
Logger.SetServiceName(constant.SERVICE_NAME)
Logger.SetLevel(constant.LOG_LEVEL)
}
}