This commit is contained in:
@@ -22,6 +22,7 @@ type Config struct {
|
||||
DatabaseURL string
|
||||
JWTSecret string
|
||||
Port string
|
||||
MetricsPort string
|
||||
GinMode string
|
||||
LogLevel string
|
||||
Debug bool
|
||||
@@ -41,6 +42,7 @@ func LoadConfig() *Config {
|
||||
DatabaseURL: getEnv("DATABASE_URL", getDefaultDatabaseURL(env)),
|
||||
JWTSecret: getRequiredEnv("JWT_SECRET"),
|
||||
Port: getEnv("PORT", "8080"),
|
||||
MetricsPort: getEnv("METRICS_PORT", "9090"),
|
||||
GinMode: getGinMode(env),
|
||||
LogLevel: getLogLevel(env),
|
||||
Debug: env == Development,
|
||||
@@ -180,6 +182,7 @@ func logConfig(config *Config) {
|
||||
log.Printf("║ 🔧 DEBUG: %-20s ║", fmt.Sprintf("%t", config.Debug))
|
||||
log.Printf("║ 📊 LOG LEVEL: %-15s ║", config.LogLevel)
|
||||
log.Printf("║ 🌐 PORT: %-20s ║", config.Port)
|
||||
log.Printf("║ 📈 METRICS PORT: %-15s ║", config.MetricsPort)
|
||||
log.Printf("║ ║")
|
||||
log.Printf("║ 📁 Configuration Files Loaded: ║")
|
||||
log.Printf("║ • .env (base configuration) ║")
|
||||
|
||||
Reference in New Issue
Block a user