Skip to content

Commit cec2942

Browse files
authored
feat: use zerolog for debug route printing (#72)
Resolves #68.
1 parent dc15468 commit cec2942

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/controllers/routing.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func Router() (*gin.Engine, error) {
3939
Logger()
4040
})))
4141

42+
gin.DebugPrintRouteFunc = func(httpMethod, absolutePath, handlerName string, numHandlers int) {
43+
log.Debug().Str("method", httpMethod).Str("path", absolutePath).Str("handler", handlerName).Int("handlers", numHandlers).Msg("route")
44+
}
45+
4246
err := models.ConnectDatabase()
4347
if err != nil {
4448
return nil, fmt.Errorf("Database connection failed with: %s", err.Error())

0 commit comments

Comments
 (0)