通用包
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hzy 523d75fa30 环境变量枚举小写 10 months ago
..
README.md eslogger 1 year ago
aliyun.go env和日志 1 year ago
glog.go env和日志 1 year ago
logger.go 环境变量枚举小写 10 months ago
std.go env和日志 1 year ago

README.md

glog:全局日志

  • v1
  • 本地环境不变,dev,pre,pro 上传阿里
// main.go 加入

func initLog() (log.Logger, func()) {

	l, f := glog.NewLogger(&glog.LoggerConfig{
		Env:     "dev",
		Id:      id,
		Name:    Name,
		Version: Version,
		AliLogConfig: glog.AliLogConfig{
			AccessKey:    "",
			AccessSecret: "",
			Endpoint:     "",
			Project:      "",
			LogStore:     "",
		},
	})
	glog.NewHelper(l)
	return l, f
}

// main函数加入
func main() {
  ...
	logger, f := initLog()
	defer f()
  ...
  app, cleanup, err := wireApp(..., logger)
}

// 使用
glog.Glog.WithContext(ctx).Error("请输入正确手机号")