Skip to content

Commit 2ba4d95

Browse files
authored
Merge pull request #51 from hellohaptik/saumilhaptik-patch-2
Update __init__.py
2 parents 818190e + e3ff6e8 commit 2ba4d95

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

FeatureToggle/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def update_cache(data: Dict[str, Any]) -> None:
106106
'To update cache Feature Toggles class needs to be initialised'
107107
)
108108

109-
LOGGER.info(f'Updating the cache data: {data}')
110109
try:
111110
FeatureToggles.__cache.set(
112111
consts.FEATURES_URL, pickle.dumps(data)
@@ -119,7 +118,6 @@ def update_cache(data: Dict[str, Any]) -> None:
119118
error_msg = f'Unknown Exception occurred while updating the redis cache: {str(err)}'
120119
LOGGER.info(error_msg)
121120
raise Exception(error_msg)
122-
LOGGER.info(f'[Feature Toggles] Cache Updated')
123121

124122
@staticmethod
125123
def __get_unleash_client():
@@ -180,8 +178,6 @@ def is_enabled_for_domain(feature_name: str,
180178
(bool): True if Feature is enabled else False
181179
"""
182180
feature_toggles = FeatureToggles.fetch_feature_toggles()
183-
LOGGER.info(f"Enable_for_domain_FT_cache_info: "
184-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
185181
return domain_name in feature_toggles.get(feature_name, {}).get('domain_names', [])
186182

187183
@staticmethod
@@ -196,8 +192,6 @@ def is_enabled_for_partner(feature_name: str,
196192
(bool): True if Feature is enabled else False
197193
"""
198194
feature_toggles = FeatureToggles.fetch_feature_toggles()
199-
LOGGER.info(f"Enable_for_partner_FT_cache_info: "
200-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
201195
return partner_name in feature_toggles.get(feature_name, {}).get('partner_names', [])
202196

203197
@staticmethod
@@ -212,8 +206,6 @@ def is_enabled_for_business(feature_name: str,
212206
(bool): True if Feature is enabled else False
213207
"""
214208
feature_toggles = FeatureToggles.fetch_feature_toggles()
215-
LOGGER.info(f"Enable_for_business_FT_cache_info: "
216-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
217209
return business_via_name in feature_toggles.get(feature_name, {}).get('business_via_names', [])
218210

219211
@staticmethod
@@ -228,8 +220,6 @@ def is_enabled_for_expert(feature_name: str,
228220
(bool): True if Feature is enabled else False
229221
"""
230222
feature_toggles = FeatureToggles.fetch_feature_toggles()
231-
LOGGER.info(f"Enable_for_expert_FT_cache_info: "
232-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
233223
return expert_email in feature_toggles.get(feature_name, {}).get('expert_emails', [])
234224

235225
@staticmethod
@@ -244,8 +234,6 @@ def is_enabled_for_team(feature_name: str,
244234
(bool): True if feature is enabled else False
245235
"""
246236
feature_toggles = FeatureToggles.fetch_feature_toggles()
247-
LOGGER.info(f"Enable_for_team_FT_cache_info: "
248-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
249237
return team_id in feature_toggles.get(feature_name, {}).get('team_ids', [])
250238

251239
@staticmethod
@@ -264,9 +252,6 @@ def fetch_feature_toggles():
264252
"""
265253
# TODO: Remove the cas and environment name from the feature toggles while returning the response
266254
response = {}
267-
LOGGER.info(f'Loading Feature Toggles from Redis')
268-
LOGGER.info(f"Fetch_feature_toggles_cache_info:"
269-
f"{FeatureToggles.fetch_feature_toggles.__wrapped__.cache_info()}")
270255
if FeatureToggles.__cache is None:
271256
LOGGER.error('To update cache Feature Toggles class needs to be initialised')
272257
return response

0 commit comments

Comments
 (0)