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

@@ -29,23 +29,37 @@ class LogPolicy {
env == 'staging';
}
static bool parseBoolFlag(String? raw) {
static ({bool enabled, bool specified}) parseOptionalBoolFlag(String? raw) {
final value = (raw ?? '').trim().toLowerCase();
return value == '1' ||
if (value == '1' ||
value == 'true' ||
value == 'yes' ||
value == 'y' ||
value == 'on';
value == 'on') {
return (enabled: true, specified: true);
}
if (value == '0' ||
value == 'false' ||
value == 'no' ||
value == 'n' ||
value == 'off') {
return (enabled: false, specified: true);
}
return (enabled: false, specified: false);
}
static bool debugEnabled({
required String? appEnv,
required String? productionDebugFlag,
}) {
final flag = parseOptionalBoolFlag(productionDebugFlag);
if (flag.specified) {
return flag.enabled;
}
if (!isProductionEnv(appEnv)) {
return true;
}
return parseBoolFlag(productionDebugFlag);
return false;
}
static bool shouldRelayClientLog({