diff options
| author | 2020-07-18 13:59:38 -0700 | |
|---|---|---|
| committer | 2020-07-31 23:02:46 -0700 | |
| commit | 90e0a3707c77b41144964dcfd3eb82714ac26b25 (patch) | |
| tree | b0d136d7e9c7f7404771a4b3d86e0b781a60f0b7 | |
| parent | Decorators: wrap mutually_exclusive to use get_arg_value (diff) | |
Decorators: add some trace logging
| -rw-r--r-- | bot/decorators.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/decorators.py b/bot/decorators.py index c9e4a0560..e370bf834 100644 --- a/bot/decorators.py +++ b/bot/decorators.py @@ -228,6 +228,8 @@ def respect_role_hierarchy(name_or_pos: function.Argument) -> t.Callable: def decorator(func: t.Callable) -> t.Callable: @wraps(func) async def wrapper(*args, **kwargs) -> None: + log.trace(f"{func.__name__}: respect role hierarchy decorator called") + bound_args = function.get_bound_args(func, args, kwargs) target = function.get_arg_value(name_or_pos, bound_args) @@ -250,6 +252,7 @@ def respect_role_hierarchy(name_or_pos: function.Argument) -> t.Callable: "someone with an equal or higher top role." ) else: + log.trace(f"{func.__name__}: {target.top_role=} < {actor.top_role=}; calling func") await func(*args, **kwargs) return wrapper return decorator |