summaryrefslogtreecommitdiff
path: root/apifw
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-12-08 10:56:46 +0200
committerLars Wirzenius <liw@liw.fi>2017-12-08 10:56:46 +0200
commitc63ff41c6047d69981af7de7b8adf4dffd29158c (patch)
tree2ddb4ce0d08317483097df667687f74909a2a0bb /apifw
parentb348773252afa44945197b200db82e0b9da67bbb (diff)
downloadapifw-c63ff41c6047d69981af7de7b8adf4dffd29158c.tar.gz
Add: log message for when callback has happened
This is for making it easier to see where time is spent.
Diffstat (limited to 'apifw')
-rw-r--r--apifw/http.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/apifw/http.py b/apifw/http.py
index 0675442..7b5a8e9 100644
--- a/apifw/http.py
+++ b/apifw/http.py
@@ -80,6 +80,12 @@ class HttpTransaction:
}
self._logger(self._combine_dicts(log, self.construct_response_log()))
+ def _log_callback(self):
+ log = {
+ 'msg_type': 'http-callback',
+ }
+ self._logger(log)
+
def _log_error(self, exc):
log = {
'msg_type': 'error',
@@ -99,6 +105,7 @@ class HttpTransaction:
self._counter()
self._log_request()
data = callback(*args, **kwargs)
+ self._log_callback()
self.amend_response()
self._log_response()
return data