feat: refactor.
This commit is contained in:
18
logger/aliyun/client.go
Normal file
18
logger/aliyun/client.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package aliyun
|
||||
|
||||
import (
|
||||
aliyunLogger "github.com/go-kratos/kratos/contrib/log/aliyun/v2"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
|
||||
)
|
||||
|
||||
// NewLogger 创建一个新的日志记录器 - Aliyun
|
||||
func NewLogger(cfg *conf.Logger) log.Logger {
|
||||
wrapped := aliyunLogger.NewAliyunLog(
|
||||
aliyunLogger.WithProject(cfg.Aliyun.Project),
|
||||
aliyunLogger.WithEndpoint(cfg.Aliyun.Endpoint),
|
||||
aliyunLogger.WithAccessKey(cfg.Aliyun.AccessKey),
|
||||
aliyunLogger.WithAccessSecret(cfg.Aliyun.AccessSecret),
|
||||
)
|
||||
return wrapped
|
||||
}
|
||||
Reference in New Issue
Block a user