You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A decorator that creates a log statement with bound variables at entry and exit of the decorated functions. The bound variables can be set, reset or updated, so every log statement from inside the function can use these.
On entry, the decorator will print the passed passed parameters along with bound variables, and upon exit it will print the returned value if any in the exit log message.
This approach helps in removing the redundant log statements for entry and exit.
The binding of default values unrelated to the context of function in decorator also helps in achieving separation of concerns.
Thanks for the great library.
The text was updated successfully, but these errors were encountered:
Yes this is what I was trying to achieve, I have implemented the decorators in my project. Nicely done, having it as a processor is a cleaner approach.
A decorator that creates a log statement with bound variables at entry and exit of the decorated functions. The bound variables can be set, reset or updated, so every log statement from inside the function can use these.
On entry, the decorator will print the passed passed parameters along with bound variables, and upon exit it will print the returned value if any in the exit log message.
This approach helps in removing the redundant log statements for entry and exit.
The binding of default values unrelated to the context of function in decorator also helps in achieving separation of concerns.
Thanks for the great library.
The text was updated successfully, but these errors were encountered: