super_gradients.common.decorators package
Submodules
super_gradients.common.decorators.deci_logger module
- super_gradients.common.decorators.deci_logger.deci_func_logger(_func=None, *, name: str = 'abstract_decorator')[source]
This decorator is used to wrap our functions with logs. It will log every enter and exit of the functon with the equivalent parameters as extras. It will also log exceptions that raises in the function. It will also log the exception time of the function.
- How it works:`
First it will check if the decorator called with name keyword. If so it will return a new decorator that its logger is the name parameter. If not it will return a new decorator that its logger is the wrapped function name. Then the return decorator will return a new function that warps the original function with the new logs. For further understanding advise real-python “fancy decorators documentation”
- Parameters
() (name) – used when called without name specify. dont pass it directly
() – The name of the logger to save logs by.
- Returns
a decorator that wraps function with logs logic.