@@ -82,7 +82,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
82
82
"Only one of either is expected" )
83
83
84
84
if sdk_key is not None :
85
- log .warn ("Deprecated sdk_key argument was passed to init. Use config object instead." )
85
+ log .warning ("Deprecated sdk_key argument was passed to init. Use config object instead." )
86
86
self ._config = Config (sdk_key = sdk_key )
87
87
else :
88
88
self ._config = config or Config .default ()
@@ -113,7 +113,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
113
113
if self ._update_processor .initialized () is True :
114
114
log .info ("Started LaunchDarkly Client: OK" )
115
115
else :
116
- log .warn ("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
116
+ log .warning ("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
117
117
"Feature Flags may not yet be available." )
118
118
119
119
def _make_event_processor (self , config ):
@@ -139,7 +139,7 @@ def _make_update_processor(self, config, store, ready):
139
139
return StreamingUpdateProcessor (config , feature_requester , store , ready )
140
140
141
141
log .info ("Disabling streaming API" )
142
- log .warn ("You should only disable the streaming API if instructed to do so by LaunchDarkly support" )
142
+ log .warning ("You should only disable the streaming API if instructed to do so by LaunchDarkly support" )
143
143
return PollingUpdateProcessor (config , feature_requester , store , ready )
144
144
145
145
def get_sdk_key (self ):
@@ -180,7 +180,7 @@ def track(self, event_name, user, data=None):
180
180
:param data: optional additional data associated with the event
181
181
"""
182
182
if user is None or user .get ('key' ) is None :
183
- log .warn ("Missing user or user key when calling track()." )
183
+ log .warning ("Missing user or user key when calling track()." )
184
184
else :
185
185
self ._send_event ({'kind' : 'custom' , 'key' : event_name , 'user' : user , 'data' : data })
186
186
@@ -194,7 +194,7 @@ def identify(self, user):
194
194
:param dict user: attributes of the user to register
195
195
"""
196
196
if user is None or user .get ('key' ) is None :
197
- log .warn ("Missing user or user key when calling identify()." )
197
+ log .warning ("Missing user or user key when calling identify()." )
198
198
else :
199
199
self ._send_event ({'kind' : 'identify' , 'key' : str (user .get ('key' )), 'user' : user })
200
200
@@ -234,7 +234,7 @@ def toggle(self, key, user, default):
234
234
235
235
.. deprecated:: 2.0.0
236
236
"""
237
- log .warn ("Deprecated method: toggle() called. Use variation() instead." )
237
+ log .warning ("Deprecated method: toggle() called. Use variation() instead." )
238
238
return self .variation (key , user , default )
239
239
240
240
def variation (self , key , user , default ):
@@ -281,16 +281,16 @@ def send_event(value, variation=None, flag=None, reason=None):
281
281
282
282
if not self .is_initialized ():
283
283
if self ._store .initialized :
284
- log .warn ("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key )
284
+ log .warning ("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key )
285
285
else :
286
- log .warn ("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
286
+ log .warning ("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
287
287
+ str (default ) + " for feature key: " + key )
288
288
reason = error_reason ('CLIENT_NOT_READY' )
289
289
send_event (default , None , None , reason )
290
290
return EvaluationDetail (default , None , reason )
291
291
292
292
if user is not None and user .get ('key' , "" ) == "" :
293
- log .warn ("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly." )
293
+ log .warning ("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly." )
294
294
295
295
try :
296
296
flag = self ._store .get (FEATURES , key , lambda x : x )
@@ -369,18 +369,18 @@ def all_flags_state(self, user, **kwargs):
369
369
:rtype: FeatureFlagsState
370
370
"""
371
371
if self ._config .offline :
372
- log .warn ("all_flags_state() called, but client is in offline mode. Returning empty state" )
372
+ log .warning ("all_flags_state() called, but client is in offline mode. Returning empty state" )
373
373
return FeatureFlagsState (False )
374
374
375
375
if not self .is_initialized ():
376
376
if self ._store .initialized :
377
- log .warn ("all_flags_state() called before client has finished initializing! Using last known values from feature store" )
377
+ log .warning ("all_flags_state() called before client has finished initializing! Using last known values from feature store" )
378
378
else :
379
- log .warn ("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state" )
379
+ log .warning ("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state" )
380
380
return FeatureFlagsState (False )
381
381
382
382
if user is None or user .get ('key' ) is None :
383
- log .warn ("User or user key is None when calling all_flags_state(). Returning empty state." )
383
+ log .warning ("User or user key is None when calling all_flags_state(). Returning empty state." )
384
384
return FeatureFlagsState (False )
385
385
386
386
state = FeatureFlagsState (True )
0 commit comments