mirror of
https://forgejo.merr.is/annika/isl-api.git
synced 2025-12-10 11:53:14 -05:00
28 lines
578 B
Go
28 lines
578 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
"strings"
|
|
)
|
|
|
|
type EnvConfigs struct {
|
|
HttpPort string `mapstructure:"HTTP_PORT"`
|
|
ConnectionString string `mapstructure:"DB_CONNECTION_STRING"`
|
|
JWKSURI string `mapstructure:"JWKS_URI"`
|
|
LogLevel string `mapstructure:"LOG_LEVEL"`
|
|
}
|
|
|
|
func (ec *EnvConfigs) GetLogLevel() slog.Level {
|
|
switch strings.ToLower(ec.LogLevel) {
|
|
case "debug":
|
|
return slog.LevelDebug
|
|
case "info":
|
|
return slog.LevelInfo
|
|
case "warn":
|
|
return slog.LevelWarn
|
|
case "error":
|
|
return slog.LevelError
|
|
default:
|
|
return slog.LevelInfo
|
|
}
|
|
}
|