Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit 561ac76

Browse files
authored
Add more context to relayer logs (#50)
1 parent 198cd01 commit 561ac76

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/modules/relay/relayer.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ func (r *Relayer) FilterByClientID() gin.HandlerFunc {
7979
if err != nil {
8080
return err
8181
}
82+
l = l.
83+
WithValues("client_id", cid).
84+
WithValues("opsSeen", opsSeen).
85+
WithValues("opsIncluded", opsIncluded)
8286

8387
OpsFailed := opsSeen - opsIncluded
8488
if OpsFailed < banThreshold {
8589
return nil
8690
}
8791

8892
isBanned = true
89-
l = l.
90-
WithValues("client_id", cid).
91-
WithValues("opsSeen", opsSeen).
92-
WithValues("opsIncluded", opsIncluded)
9393
return nil
9494
})
9595
if err != nil {
@@ -102,6 +102,8 @@ func (r *Relayer) FilterByClientID() gin.HandlerFunc {
102102
l.Info("client banned")
103103
c.Status(http.StatusForbidden)
104104
c.Abort()
105+
} else {
106+
l.Info("client ok")
105107
}
106108
}
107109
}

0 commit comments

Comments
 (0)