Logging geocode response

This commit is contained in:
Fabio Manganiello 2018-05-22 21:34:06 +00:00
parent f4da6ebb1b
commit 2c7880874d

View file

@ -1,4 +1,5 @@
import json import json
import logging
import requests import requests
from platypush.message.response import Response from platypush.message.response import Response
@ -29,6 +30,8 @@ class GoogleMapsPlugin(GooglePlugin):
if 'results' in response and response['results']: if 'results' in response and response['results']:
result = response['results'][0] result = response['results'][0]
logging.info('Google Maps geocode response for latlng ({},{}): {}'.
format(latitude, longitude, result))
for addr_component in result['address_components']: for addr_component in result['address_components']:
for component_type in addr_component['types']: for component_type in addr_component['types']: