Different attempt at logging
This commit is contained in:
parent
271ba627ae
commit
672670cf9f
7
app.py
7
app.py
|
@ -9,6 +9,7 @@ from bottle import (
|
||||||
)
|
)
|
||||||
|
|
||||||
import thesethreewords as these
|
import thesethreewords as these
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
example_locs = [("sydney", (-33.867480754852295, 151.20700120925903)),
|
example_locs = [("sydney", (-33.867480754852295, 151.20700120925903)),
|
||||||
|
@ -51,14 +52,14 @@ def showMapFromLatLng(lat, lng):
|
||||||
# API
|
# API
|
||||||
@get('/api/<lat:float>,<lng:float>')
|
@get('/api/<lat:float>,<lng:float>')
|
||||||
def latLngToHash(lat, lng):
|
def latLngToHash(lat, lng):
|
||||||
print(lat)
|
print(lat, file=sys.stdout)
|
||||||
print(lng)
|
print(lng, file=sys.stdout)
|
||||||
try:
|
try:
|
||||||
three = these.three_words(lat,lng)
|
three = these.three_words(lat,lng)
|
||||||
six = these.six_words(lat,lng)
|
six = these.six_words(lat,lng)
|
||||||
return {'three': three, 'six': six}
|
return {'three': three, 'six': six}
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print(error)
|
print(error, file=sys.stderr)
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue