Skip to content

Commit

Permalink
kill the gin logging for now
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-nettica committed Jan 23, 2025
1 parent e1ba683 commit 265340a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/nettica-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"io"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -62,11 +63,16 @@ func main() {
if os.Getenv("GIN_MODE") == "debug" {
// set gin release debug
gin.SetMode(gin.DebugMode)
gin.DisableConsoleColor()
log.SetLevel(log.InfoLevel)
} else {
// set gin release mode
gin.SetMode(gin.ReleaseMode)
// disable console color
gin.DisableConsoleColor()
// Disable Gin's default logger in release mode
gin.DefaultWriter = io.Discard
gin.DefaultErrorWriter = io.Discard
// log level info
log.SetLevel(log.InfoLevel)
}
Expand Down

0 comments on commit 265340a

Please sign in to comment.