Skip to content

Commit

Permalink
chore: add debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
saitofun committed Jun 20, 2024
1 parent 351757a commit 8fdb5d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/sequencer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ func RunDebugServer(ctx context.Context) {
c.Status(http.StatusNotFound)
},
)
eng.Handle(
http.MethodGet, "/version",
func(c *gin.Context) {
c.JSON(http.StatusOK, map[string]string{
"service_name": Name,
"feature": Feature,
"version": Version,
"commit_id": CommitID,
"build_at": Date,
})
},
)
eng.Run(":80")
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/modules/event/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func Handle(ctx context.Context, subtopic, topic string, data any) (err error) {
if t, ok := data.(TxEventUnmarshaler); ok {
ll = ll.WithValues("block", t.BlockNumber())
}
if t, ok := data.(WithIMEI); ok {
ll = ll.WithValues("imei", t.GetIMEI())
}
if err != nil {
ll.Error(err, "failed to handle event")
} else {
Expand Down

0 comments on commit 8fdb5d4

Please sign in to comment.