Skip to content

Commit 2e8edfd

Browse files
committed
Add req.SetLogFields
1 parent 31a8b77 commit 2e8edfd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

keysign/request.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ type Request struct {
99
SignerPubKeys []string `json:"signer_pub_keys"`
1010
BlockHeight int64 `json:"block_height"`
1111
Version string `json:"tss_version"`
12+
13+
logFields map[string]any
1214
}
1315

1416
func NewRequest(pk string, msgs []string, blockHeight int64, signers []string, version string) Request {
@@ -24,4 +26,12 @@ func NewRequest(pk string, msgs []string, blockHeight int64, signers []string, v
2426
func (r *Request) MarshalZerologObject(e *zerolog.Event) {
2527
e.Strs("request.messages", r.Messages)
2628
e.Int64("request.block_height", r.BlockHeight)
29+
30+
if len(r.logFields) != 0 {
31+
e.Fields(r.logFields)
32+
}
33+
}
34+
35+
func (r *Request) SetLogFields(kv map[string]any) {
36+
r.logFields = kv
2737
}

0 commit comments

Comments
 (0)