diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-03-09 09:34:10 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-03-09 09:34:10 +0200 |
commit | b87fb6280e9ba532b53c794ba247f8633ef3b0be (patch) | |
tree | be3e4c2f599eba137c8f61eb8902537740ffd0fd | |
parent | 53c95e96c5b60bd8a1f651ec231e28ad61736390 (diff) | |
download | effi-reg-b87fb6280e9ba532b53c794ba247f8633ef3b0be.tar.gz |
Add: logging statements at various points
-rwxr-xr-x | effiapi | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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') |