Handle logger levels

This commit is contained in:
Dan Sosedoff
2022-12-01 12:49:24 -06:00
parent c996d71378
commit 72ecd20dd1
2 changed files with 14 additions and 3 deletions

View File

@@ -184,9 +184,13 @@ func printVersion() {
}
func startServer() {
router := gin.New()
logger := logrus.New()
if options.Debug {
logger.SetLevel(logrus.DebugLevel)
}
router.Use(api.RequestLogger(logrus.New()))
router := gin.New()
router.Use(api.RequestLogger(logger))
router.Use(gin.Recovery())
// Enable HTTP basic authentication only if both user and password are set