Created
February 9, 2010 17:47
-
-
Save batok/299456 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def logger(f, name=None): | |
# Closure to remember our name and function objects | |
if name is None: | |
name = f.func_name | |
def wrapped(*args, **kwargs): | |
#print "Calling", name, args, kwargs | |
log_queue.append((name, xdt.now().timetuple()[:6])) | |
result = f(*args, **kwargs) | |
#print "Called", name, args, kwargs, "returned", repr(result) | |
return result | |
wrapped.__doc__ = f.__doc__ | |
return wrapped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment