Skip to content

Commit

Permalink
fix: use flask logger rather than print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Dec 6, 2024
1 parent 7bb2170 commit 440a783
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/masquerade/providers/web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import re

import requests
from flask import current_app
from requests.adapters import HTTPAdapter
from sweeper.address_parser import Address
from urllib3.util.retry import Retry
Expand Down Expand Up @@ -113,7 +114,7 @@ def make_geocode_request(address, zone, out_spatial_reference, max_locations):
try:
result = response.json()["result"]
except Exception:
print(f"Error parsing result: {response.text}")
current_app.warning(f"Error parsing web api geocoding result: {response.text}")
return []

if "score" in result:
Expand Down Expand Up @@ -223,7 +224,7 @@ def reverse_geocode(x: float, y: float, spatial_reference: int, input_x: float,
try:
api_result = response.json()["result"]
except Exception:
print(f"Error parsing result: {response.text}")
current_app.warning(f"Error parsing web api reverse geocode result: {response.text}")
return None

street = api_result["address"]["street"]
Expand Down

0 comments on commit 440a783

Please sign in to comment.