Skip to content

Commit

Permalink
Be more verbose when calling and returning result from tasks if using
Browse files Browse the repository at this point in the history
DEBUG log level
  • Loading branch information
dnaeon committed Feb 16, 2015
1 parent bff984d commit 75a0a76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vpoller/task/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def task(name, required=None):
def decorator(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
logger.debug('Executing task %s', name)
try:
result = fn(*args, **kwargs)
except Exception as e:
Expand All @@ -61,6 +62,7 @@ def wrapper(*args, **kwargs):
}
logger.warning('Task %s failed: %s', name, tb)
finally:
logger.debug('Returning result from task %s: %s', name, result)
return result
t = Task(name=name, function=wrapper, required=required)
registry.register(t)
Expand Down

0 comments on commit 75a0a76

Please sign in to comment.