From 102e217b682edc183c0816ee93b7c631f35cafd5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 16 Oct 2017 21:34:53 +0300 Subject: Add: some logging of GET etc calls --- ick2/controllerapi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ick2/controllerapi.py') diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index 6d25a7d..1cf1aef 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -83,7 +83,7 @@ class APIbase: # pragma: no cover def GET(self, callback): def wrapper(content_type, body, **kwargs): ick2.log.log( - 'xxx', msg_text='GET called', kwargs=kwargs, + 'trace', msg_text='GET called', kwargs=kwargs, content_type=content_type, body=body) try: if 'raw_uri_path' in kwargs: @@ -98,6 +98,9 @@ class APIbase: # pragma: no cover def POST(self, callback): def wrapper(content_type, body, **kwargs): + ick2.log.log( + 'trace', msg_text='POST called', kwargs=kwargs, + content_type=content_type, body=body) body = callback(body) ick2.log.log('trace', msg_text='returned body', body=repr(body)) return created(body) @@ -105,6 +108,9 @@ class APIbase: # pragma: no cover def PUT(self, callback): def wrapper(content_type, body, **kwargs): + ick2.log.log( + 'trace', msg_text='PUT called', kwargs=kwargs, + content_type=content_type, body=body) if 'raw_uri_path' in kwargs: del kwargs['raw_uri_path'] body = callback(body, **kwargs) @@ -114,6 +120,9 @@ class APIbase: # pragma: no cover def DELETE(self, callback): def wrapper(content_type, body, **kwargs): + ick2.log.log( + 'trace', msg_text='DELETE called', kwargs=kwargs, + content_type=content_type, body=body) try: if 'raw_uri_path' in kwargs: del kwargs['raw_uri_path'] -- cgit v1.2.1