Skip to content

Commit

Permalink
Merge pull request #63 from mohansriharsha/master
Browse files Browse the repository at this point in the history
implemented logged metrics and included params in error logs
  • Loading branch information
Ram Idavalapati authored Aug 7, 2018
2 parents 66d10ef + 02ea298 commit 71bcb12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ deploy:
- LICENSE
- kwikapi/api.py
- kwikapi/__init__.py
name: kwikapi-0.4.0
tag_name: 0.4.0
name: kwikapi-0.4.1
tag_name: 0.4.1
on:
repo: deep-compute/kwikapi
- provider: pypi
Expand Down
5 changes: 3 additions & 2 deletions kwikapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,15 @@ def handle_request(self, request):
method=rinfo.method, compute_time=tcompute, serialize_time=t.value,
deserialize_time=rinfo.time_deserialize,
__params=get_loggable_params(request.fn_params or {}),
protocol=request.protocol, type='log', **request.metrics)
protocol=request.protocol, type='logged_metric', **request.metrics)

except Exception as e:
message = e.message if hasattr(e, 'message') else str(e)
message = '[(%s) %s: %s]' % (self.api._id, e.__class__.__name__, message)

_log = request.log if hasattr(request, 'log') else self.log
_log.exception('handle_request_error', message=message)
_log.exception('handle_request_error', message=message,
__params=get_loggable_params(request.fn_params or {}))
response.write(dict(success=False, message=message), protocol)

response.flush()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = '0.4.0'
version = '0.4.1'
setup(
name="kwikapi",
version=version,
Expand Down

0 comments on commit 71bcb12

Please sign in to comment.