feat: refactor go.mod.

This commit is contained in:
tx7do
2024-11-14 15:47:21 +08:00
parent f3d17b9d34
commit 120029bb01
16 changed files with 675 additions and 175 deletions

View File

@@ -3,11 +3,16 @@ package fluent
import (
fluentLogger "github.com/go-kratos/kratos/contrib/log/fluent/v2"
"github.com/go-kratos/kratos/v2/log"
conf "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
)
// NewLogger 创建一个新的日志记录器 - Fluent
func NewLogger(cfg *conf.Logger) log.Logger {
if cfg == nil || cfg.Fluent == nil {
return nil
}
wrapped, err := fluentLogger.NewLogger(cfg.Fluent.Endpoint)
if err != nil {
panic("create fluent logger failed")