This is related to #4.
Currently, be because the values are all static - context as decorator is rather useless. Once #4 is implemented, add some special helpers for automatically adding information about the decorated function and what arguments were passed to it at runtime.
With this feature, something like this, should become possible:
from loggingex.context import context, argument
@context(foo_args=argument(arg=True))
def foo(*args):
return sum(args)
@context(bar_name=argument("name"), bar_message=argument(arg=0, kwarg="message"))
def bar(message, *, name="default"):
print("%s: %s" % (name, message))
Note: When used as context manager, these argument values would be ignored (or some default values would need to be returned for them).
This is related to #4.
Currently, be because the values are all static -
contextas decorator is rather useless. Once #4 is implemented, add some special helpers for automatically adding information about the decorated function and what arguments were passed to it at runtime.With this feature, something like this, should become possible:
Note: When used as context manager, these argument values would be ignored (or some default values would need to be returned for them).