feat: refactor.

This commit is contained in:
tx7do
2024-05-06 12:05:57 +08:00
parent e043284a58
commit cf902efeca
64 changed files with 3056 additions and 505 deletions

17
logger/fluent/client.go Normal file
View File

@@ -0,0 +1,17 @@
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 {
wrapped, err := fluentLogger.NewLogger(cfg.Fluent.Endpoint)
if err != nil {
panic("create fluent logger failed")
return nil
}
return wrapped
}