1
0
forked from baron/baron-sso

make dev/dev-debug 구분.

This commit is contained in:
2026-05-20 13:34:19 +09:00
parent 0155ee4ee7
commit 5496735e2f
15 changed files with 192 additions and 45 deletions

View File

@@ -37,20 +37,25 @@ func IsProductionEnv(appEnv string) bool {
return IsProductionLikeEnv(appEnv)
}
func parseBoolFlag(raw string) bool {
func parseOptionalBoolFlag(raw string) (bool, bool) {
switch strings.ToLower(strings.TrimSpace(raw)) {
case "1", "true", "yes", "y", "on":
return true
return true, true
case "0", "false", "no", "n", "off":
return false, true
default:
return false
return false, false
}
}
func ClientDebugEnabled(appEnv, productionDebugFlag string) bool {
func ClientDebugEnabled(appEnv, debugFlag string) bool {
if enabled, ok := parseOptionalBoolFlag(debugFlag); ok {
return enabled
}
if !IsProductionEnv(appEnv) {
return true
}
return parseBoolFlag(productionDebugFlag)
return false
}
func NormalizeClientLogLevel(level string) slog.Level {