feat: add flag for log level

This commit is contained in:
Lakhan Samani
2022-05-25 15:04:26 +05:30
parent 714b79e4ab
commit 8bee421d0a
6 changed files with 95 additions and 64 deletions

3
server/env/env.go vendored
View File

@@ -5,7 +5,6 @@ import (
"os"
"strings"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/joho/godotenv"
log "github.com/sirupsen/logrus"
@@ -30,6 +29,7 @@ func InitRequiredEnv() error {
if envstore.ARG_ENV_FILE != nil && *envstore.ARG_ENV_FILE != "" {
envPath = *envstore.ARG_ENV_FILE
}
log.Info("env path: ", envPath)
err := godotenv.Load(envPath)
if err != nil {
@@ -121,7 +121,6 @@ func InitAllEnv() error {
if envData.StringEnv[constants.EnvKeyEnv] == "production" {
envData.BoolEnv[constants.EnvKeyIsProd] = true
gin.SetMode(gin.ReleaseMode)
} else {
envData.BoolEnv[constants.EnvKeyIsProd] = false
}