1
0
mirror of https://github.com/go-kratos/kratos.git synced 2024-12-28 21:09:04 +02:00

refactor(log) aliyun use the same interface name (#2251)

* feat(log): add tencent cls

fix

update

* refactor(log) use the same interface name

* fix(log) tencent toString
This commit is contained in:
Germiniku 2022-08-16 22:22:35 +09:00 committed by GitHub
parent 11cd43e3c3
commit de2f93fbec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,13 +7,13 @@ import (
sls "github.com/aliyun/aliyun-log-go-sdk"
"github.com/aliyun/aliyun-log-go-sdk/producer"
klog "github.com/go-kratos/kratos/v2/log"
log "github.com/go-kratos/kratos/v2/log"
"google.golang.org/protobuf/proto"
)
// Log see more detail https://github.com/aliyun/aliyun-log-go-sdk
type Log interface {
klog.Logger
type Logger interface {
log.Logger
GetProducer() *producer.Producer
Close() error
}
@ -78,7 +78,7 @@ func (a *aliyunLog) Close() error {
return a.producer.Close(5000)
}
func (a *aliyunLog) Log(level klog.Level, keyvals ...interface{}) error {
func (a *aliyunLog) Log(level log.Level, keyvals ...interface{}) error {
buf := level.String()
levelTitle := "level"
@ -108,7 +108,7 @@ func (a *aliyunLog) Log(level klog.Level, keyvals ...interface{}) error {
}
// NewAliyunLog new a aliyun logger with options.
func NewAliyunLog(options ...Option) Log {
func NewAliyunLog(options ...Option) Logger {
opts := defaultOptions()
for _, o := range options {
o(opts)