|
@@ -252,3 +252,24 @@ func WrapMeta(err error, metas ...Meta) (fields []zap.Field) {
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// RestyClientLogger use by resty.Client
|
|
|
+func RestyClientLogger(logger *zap.Logger) *RestyClientLog {
|
|
|
+ return &RestyClientLog{logger: logger}
|
|
|
+}
|
|
|
+
|
|
|
+type RestyClientLog struct {
|
|
|
+ logger *zap.Logger
|
|
|
+}
|
|
|
+
|
|
|
+func (r *RestyClientLog) Errorf(format string, v ...any) {
|
|
|
+ r.logger.Sugar().Errorf(format, v)
|
|
|
+}
|
|
|
+
|
|
|
+func (r *RestyClientLog) Warnf(format string, v ...any) {
|
|
|
+ r.logger.Sugar().Warnf(format, v)
|
|
|
+}
|
|
|
+
|
|
|
+func (r *RestyClientLog) Debugf(format string, v ...any) {
|
|
|
+ r.logger.Sugar().Debugf(format, v)
|
|
|
+}
|