Skip to content

Commit

Permalink
fix log level for conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
dzakharchuk committed Feb 19, 2024
1 parent 85afdc6 commit d50477b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions featureflags_client/http/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def proc(ctx: Dict[str, Any], _value: Optional[Set] = None) -> bool:

def check_proc(check: Check) -> Callable:
if check.value is None:
log.info(f"Check[{check}].value is None")
log.debug(f"Check[{check}].value is None")
return false

return OPERATIONS_MAP[check.operator](check.variable.name, check.value)
Expand All @@ -153,7 +153,9 @@ def check_proc(check: Check) -> Callable:
def flag_proc(flag: Flag) -> Optional[Callable]:
if not flag.overridden:
# Flag was not overridden on server, use value from defaults.
log.info(f"Flag[{flag.name}] is not overriden yet, using default value")
log.debug(
f"Flag[{flag.name}] is not overriden yet, using default value"
)
return None

conditions = []
Expand All @@ -163,7 +165,7 @@ def flag_proc(flag: Flag) -> Optional[Callable]:
# in case of invalid condition it would be safe to replace it
# with a falsish condition
if not checks_procs:
log.info("Condition has empty checks")
log.debug("Condition has empty checks")
checks_procs = [false]

conditions.append(checks_procs)
Expand All @@ -176,7 +178,9 @@ def proc(ctx: Dict[str, Any]) -> bool:
)

else:
log.info(f"Flag[{flag.name}] is disabled or do not have any conditions")
log.debug(
f"Flag[{flag.name}] is disabled or do not have any conditions"
)

def proc(ctx: Dict[str, Any]) -> bool:
return flag.enabled
Expand Down

0 comments on commit d50477b

Please sign in to comment.