From 9e074d7a5a7750f14ce202f314f687812780b32e Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Thu, 4 May 2023 17:49:24 +0200 Subject: [PATCH] file fields --- metric/log.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/metric/log.go b/metric/log.go index 23e76591..65ab4790 100644 --- a/metric/log.go +++ b/metric/log.go @@ -39,6 +39,18 @@ func Addr(val string) zap.Field { return zap.String("addr", val) } +func FileId(fileId string) zap.Field { + return zap.String("fileId", fileId) +} + +func Cid(cid string) zap.Field { + return zap.String("cid", cid) +} + +func Size(size int) zap.Field { + return zap.Int("size", size) +} + func (m *metric) RequestLog(ctx context.Context, rpc string, fields ...zap.Field) { peerId, _ := peer.CtxPeerId(ctx) ak, _ := peer.CtxPubKey(ctx)