file fields

This commit is contained in:
Sergey Cherepanov 2023-05-04 17:49:24 +02:00 committed by Mikhail Iudin
parent 0664c310fa
commit 9e074d7a5a
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0

View File

@ -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)