summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-03-09 09:34:10 +0200
committerLars Wirzenius <liw@liw.fi>2019-03-09 09:34:10 +0200
commitb87fb6280e9ba532b53c794ba247f8633ef3b0be (patch)
treebe3e4c2f599eba137c8f61eb8902537740ffd0fd
parent53c95e96c5b60bd8a1f651ec231e28ad61736390 (diff)
downloadeffi-reg-b87fb6280e9ba532b53c794ba247f8633ef3b0be.tar.gz
Add: logging statements at various points
-rwxr-xr-xeffiapi8
1 files changed, 7 insertions, 1 deletions
diff --git a/effiapi b/effiapi
index e8a4cf7..ecb8bc9 100755
--- a/effiapi
+++ b/effiapi
@@ -207,10 +207,12 @@ class API:
]
for route in routes:
+ logging.debug('Adding route', repr(route))
bottleapp.route(**route)
def _call(self, callback):
def helper():
+ logging.debug('_call called')
try:
r = bottle.request
logging.info('Request: method=%s', r.method)
@@ -221,7 +223,7 @@ class API:
logging.info('Request: body: %r', r.body.read())
ret = callback()
except BaseException as e:
- logging.error(str(e))
+ logging.error(str(e), exc_info=True)
raise
else:
return ret
@@ -301,6 +303,10 @@ else:
logging.info("Using RealHTTPAPI")
httpapi = RealHTTPAPI()
+logging.debug('Creating API')
app = bottle.default_app()
api = API(httpapi, app, config)
+
+logging.info('Starting application')
app.run(host='127.0.0.1', port=8080)
+logglng.critical('Application ended')