From b87fb6280e9ba532b53c794ba247f8633ef3b0be Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 9 Mar 2019 09:34:10 +0200 Subject: Add: logging statements at various points --- effiapi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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') -- cgit v1.2.1