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