Skip to content

Commit 2b33135

Browse files
authored
FFM-9866 Flag/Segment not found warning change (#84)
1 parent 9906bcf commit 2b33135

File tree

15 files changed

+75
-33
lines changed

15 files changed

+75
-33
lines changed
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1+
import logging
12
import time
23

34
from featureflags.evaluations.auth_target import Target
45
from featureflags.client import CfClient
56
from featureflags.util import log
67

8+
79
def main():
8-
log.debug("Starting example")
10+
log.setLevel(logging.INFO)
11+
log.info("Starting example")
912
api_key = "Your API Key"
1013
client = CfClient(api_key)
1114

12-
target = Target(identifier='HT_1', name="Harness_Target_1", attributes={"location": "emea"})
15+
target = Target(identifier='HT_1', name="Harness_Target_1",
16+
attributes={"location": "emea"})
1317

1418
while True:
15-
result = client.bool_variation('identifier_of_your_bool_flag', target, False)
16-
log.debug("Result %s", result)
19+
result = client.bool_variation('identifier_of_your_bool_flag', target,
20+
False)
21+
log.info("Result %s", result)
1722
time.sleep(10)
1823

24+
1925
if __name__ == "__main__":
2026
main()
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
import logging
12
import time
23

34
from featureflags.evaluations.auth_target import Target
45
from featureflags.client import CfClient
56
from featureflags.util import log
67

8+
79
def main():
8-
log.debug("Starting example")
10+
log.setLevel(logging.INFO)
11+
log.info("Starting example")
912
api_key = "Your API key"
1013
client = CfClient(api_key)
1114

12-
target = Target(identifier='HT_1', name="Harness_Target_1", attributes={"location": "emea"})
15+
target = Target(identifier='HT_1', name="Harness_Target_1",
16+
attributes={"location": "emea"})
1317

1418
for x in range(10):
1519
result = client.bool_variation('harnessappdemodarkmode', target, False)
16-
log.debug("Result %s", result)
20+
log.info("Result %s", result)
1721
time.sleep(10)
1822

1923
client.close()
2024

25+
2126
if __name__ == "__main__":
2227
main()

examples/getting_started/getting_started.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging
2+
13
from featureflags.client import CfClient
24
from featureflags.config import *
35
from featureflags.evaluations.auth_target import Target
@@ -13,6 +15,7 @@
1315
flagName = os.getenv('FF_FLAG_NAME', "harnessappdemodarkmode")
1416

1517
def main():
18+
log.setLevel(logging.INFO)
1619
log.info("Harness SDK Getting Started")
1720
# Create a Feature Flag Client
1821
client = CfClient(api_key)

examples/json_variation_example/json_variation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
import logging
12
import time
23

34
from featureflags.evaluations.auth_target import Target
45
from featureflags.client import CfClient
56
from featureflags.util import log
67

78
def main():
8-
log.debug("Starting example")
9+
log.setLevel(logging.INFO)
10+
log.info("Starting example")
911
api_key = "Your API Key"
1012
client = CfClient(api_key)
1113

1214
target = Target(identifier='HT_1', name="Harness_Target_1", attributes={"location": "emea"})
1315

1416
while True:
1517
result = client.json_variation('identifier_of_your_json_flag', target, {})
16-
log.debug("Result %s", result)
18+
log.info("Result %s", result)
1719
time.sleep(10)
1820

1921
if __name__ == "__main__":

examples/number_variation_example/number_variation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
import logging
12
import time
23

34
from featureflags.evaluations.auth_target import Target
45
from featureflags.client import CfClient
56
from featureflags.util import log
67

78
def main():
8-
log.debug("Starting example")
9+
log.setLevel(logging.INFO)
10+
log.info("Starting example")
911
api_key = "Your API Key"
1012
client = CfClient(api_key)
1113

1214
target = Target(identifier='harness')
1315

1416
while True:
1517
result = client.number_variation('identifier_of_your_number_flag', target, -1)
16-
log.debug("Result %s", result)
18+
log.info("Result %s", result)
1719
time.sleep(10)
1820

1921
if __name__ == "__main__":

examples/simple_example/simple_example.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import os
23
import time
34

@@ -8,19 +9,26 @@
89

910
api_key = os.getenv('FF_API_KEY', "")
1011

12+
1113
def main():
14+
15+
log.setLevel(logging.INFO)
16+
api_key = "Your API Key"
17+
1218
# Create a Feature Flag Client
1319
client = CfClient(apiKey)
1420

15-
# Create a target (different targets can get different results based on rules that you add in the UI).
16-
target = Target(identifier='HT_1', name="Harness_Target_1", attributes={"location": "emea"})
21+
# Create a target (different targets can get different results based on
22+
# rules that you add in the UI).
23+
target = Target(identifier='HT_1', name="Harness_Target_1",
24+
attributes={"location": "emea"})
1725

18-
# Loop forever reporting the state of the flag. If there is an error the default value will be returned
26+
# Loop forever reporting the state of the flag. If there is an error
27+
# the default value will be returned
1928
while True:
2029
result = client.bool_variation('harnessappdemodarkmode', target, False)
2130
log.info("Flag variation %s", result)
2231
time.sleep(10)
23-
2432

2533

2634
if __name__ == "__main__":

examples/string_variation_example/string_variation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
import logging
12
import time
23

34
from featureflags.evaluations.auth_target import Target
45
from featureflags.client import CfClient
56
from featureflags.util import log
67

78
def main():
8-
log.debug("Starting example")
9+
log.setLevel(logging.INFO)
10+
log.info("Starting example")
911
api_key = "Your API Key"
1012
client = CfClient(api_key)
1113

1214
target = Target(identifier='harness')
1315

1416
while True:
1517
result = client.string_variation('identifier_of_your_string_flag', target, "")
16-
log.debug("Result %s", result)
18+
log.info("Result %s", result)
1719
time.sleep(10)
1820

1921
if __name__ == "__main__":
356 Bytes
Binary file not shown.

examples/url_change_example/url_change.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import os
23
import time
34

@@ -9,7 +10,8 @@
910

1011

1112
def main():
12-
log.debug("Starting example")
13+
log.setLevel(logging.INFO)
14+
log.info("Starting example")
1315
api_key = os.getenv('FF_API_KEY', "")
1416
client = CfClient(api_key,
1517
with_base_url("https://config.ff.harness.io/api/1.0"),
@@ -19,7 +21,7 @@ def main():
1921

2022
while True:
2123
result = client.bool_variation('harnessappdemodarkmode', target, False)
22-
log.debug("Result %s", result)
24+
log.info("Result %s", result)
2325
time.sleep(10)
2426

2527
if __name__ == "__main__":

examples/wait_for_initialization_example/wait_for_initialization.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import time
23

34
from featureflags.config import with_base_url, with_events_url
@@ -7,20 +8,21 @@
78

89

910
def main():
10-
log.debug("Starting example")
11+
log.setLevel(logging.INFO)
12+
log.info("Starting example")
1113
api_key = "Your API Key"
1214
client = CfClient(api_key)
1315
# Don't continue until all flags and groups have been loaded into the cache.
14-
log.debug("Waiting to load all flags and groups before proceeding")
16+
log.info("Waiting to load all flags and groups before proceeding")
1517
client.wait_for_initialization()
1618

1719
# If required you can check the initialized status of the Client at anytime
18-
log.debug("Client is_initialized status is %s", client.is_initialized())
20+
log.info("Client is_initialized status is %s", client.is_initialized())
1921
target = Target(identifier='harness')
2022

2123
while True:
2224
result = client.bool_variation('identifier_of_your_bool_flag', target, False)
23-
log.debug("Result %s", result)
25+
log.info("Result %s", result)
2426
time.sleep(10)
2527

2628

0 commit comments

Comments
 (0)