From 1dc145715331246acdea4f36ba63e653d34d2134 Mon Sep 17 00:00:00 2001 From: Daniel Grams Date: Wed, 18 Aug 2021 14:14:17 +0200 Subject: [PATCH] Fix maputils logger #271 --- project/maputils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/project/maputils.py b/project/maputils.py index ac9e39d..e39e98d 100644 --- a/project/maputils.py +++ b/project/maputils.py @@ -1,8 +1,9 @@ -import logging import os import googlemaps +from project import app + google_maps_api_key = os.getenv("GOOGLE_MAPS_API_KEY") gmaps = googlemaps.Client(key=google_maps_api_key) if google_maps_api_key else None @@ -18,7 +19,7 @@ def find_gmaps_places(query: str) -> list: result = list(filter(lambda p: "place_id" in p, places)) except Exception as e: # pragma: no cover - logging.exception(e) + app.logger.exception(e) return result @@ -37,6 +38,6 @@ def get_gmaps_place(gmaps_id) -> dict: if place["status"] == "OK": result = place["result"] except Exception as e: # pragma: no cover - logging.exception(e) + app.logger.exception(e) return result