Skip to content

Commit

Permalink
Simplifies a few lines of code in log_exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
RobRuana committed May 1, 2017
1 parent 897d2f9 commit b8f57aa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pockets/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ def log_exceptions(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
try:
a = args or []
a = [str(x)[:255] for x in a]
kw = kwargs or {}
kw = dict([(str(k)[:255], str(v)[:255]) for k, v in kw.items()])
a = [str(x)[:255] for x in args]
kw = dict([(k[:255], str(v)[:255]) for k, v in kwargs.items()])
log.trace('Calling %s.%s %r %r', fn.__module__, fn.__name__, a, kw)
return fn(*args, **kwargs)
except Exception as e:
Expand Down

0 comments on commit b8f57aa

Please sign in to comment.