From de2f93fbec3d80a81518add3328862d70061eaa5 Mon Sep 17 00:00:00 2001 From: Germiniku Date: Tue, 16 Aug 2022 22:22:35 +0900 Subject: [PATCH] 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 --- contrib/log/aliyun/aliyun.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/log/aliyun/aliyun.go b/contrib/log/aliyun/aliyun.go index 0c1e1987f..53fdefde8 100644 --- a/contrib/log/aliyun/aliyun.go +++ b/contrib/log/aliyun/aliyun.go @@ -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)