Skip to content

Commit

Permalink
We only use Gin's Logging() middleware in debug mode
Browse files Browse the repository at this point in the history
If we enable it even when not debugging, it fills the systemd journal
on the production server with useless messages
  • Loading branch information
justinclift committed Jan 7, 2024
1 parent 4566cb4 commit 4fa6cd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ func setupRouter(testingMode bool) (router *gin.Engine, err error) {
// Set up Gin
router = gin.New()
router.Use(gin.Recovery())
if !testingMode {
// We don't use the Gin Logger middleware when running go test
if debug {
// We only use the Gin Logger middleware when debugging is turned on
router.Use(gin.Logger())
}

Expand Down

0 comments on commit 4fa6cd2

Please # to comment.