Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
printing some logs to try to understand what's happening
  • Loading branch information
nataliejschultz committed Jun 14, 2024
1 parent b1f7d4f commit 8186a2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions emission/individual_tests/TestOverpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import requests
import emission.net.ext_service.transit_matching.match_stops as enetm
import logging

#Set up query
OVERPASS_KEY = os.environ.get("OVERPASS_KEY")
Expand All @@ -22,6 +23,8 @@

class OverpassTest(unittest.TestCase):
def setUp(self):
loglevel = logging.DEBUG
logging.basicConfig(level=loglevel)
sample_data = '[out:json][bbox];way[amenity=parking];out;&bbox=-122.1111238,37.4142118,-122.1055791,37.4187945'
call_base = 'api/interpreter?data='
self.de_url_base = 'https://lz4.overpass-api.de/'+ call_base + sample_data
Expand Down
2 changes: 2 additions & 0 deletions emission/net/ext_service/transit_matching/match_stops.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def make_request_and_catch(overpass_query):
try:
response = requests.post(url + "api/interpreter", data=overpass_query)
print("*********RESPONSE:" , response.request.url)
("*********RESPONSE header:" , response.request.headers)

except requests.exceptions.ChunkedEncodingError as e:
logging.info("ChunkedEncodingError while creating request %s" % (e))
time.sleep(10)
Expand Down

0 comments on commit 8186a2d

Please sign in to comment.