summaryrefslogtreecommitdiff
path: root/ick2/controllerapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-10-16 21:34:53 +0300
committerLars Wirzenius <liw@liw.fi>2017-10-16 21:34:53 +0300
commit102e217b682edc183c0816ee93b7c631f35cafd5 (patch)
treebaac03c83d1f5a570c82ecdd46f571111bffe955 /ick2/controllerapi.py
parent1b6b97834362ba42b7fcc5cc6f7c1d7398198ce0 (diff)
downloadick2-102e217b682edc183c0816ee93b7c631f35cafd5.tar.gz
Add: some logging of GET etc calls
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r--ick2/controllerapi.py11
1 files changed, 10 insertions, 1 deletions
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']