forked from baron/baron-sso
make dev/dev-debug 구분.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user