Change logging to debug level
This commit is contained in:
parent
40b6f84cb0
commit
a13b0a4173
@ -23,6 +23,8 @@ __all__ = "multidispatch"
|
||||
T = TypeVar("T", bound=Union[Callable[..., Any], type])
|
||||
KeyType = Union[type, None]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def multidispatch(*argtypes: KeyType) -> Callable[[T], FunctionDispatcher[T]]:
|
||||
"""Declare function as multidispatch.
|
||||
@ -127,7 +129,7 @@ class FunctionDispatcher(Generic[T]):
|
||||
trimmed_args = args[: self.params_arity]
|
||||
rule = self.registry.lookup(*trimmed_args)
|
||||
if not rule:
|
||||
logging.error(self.registry._tree)
|
||||
logger.debug(self.registry._tree)
|
||||
raise TypeError(f"No available rule found for {trimmed_args!r}")
|
||||
return rule(*args, **kwargs)
|
||||
|
||||
|
@ -17,6 +17,8 @@ __all__ = ("multimethod", "has_multimethods")
|
||||
C = TypeVar("C")
|
||||
T = TypeVar("T", bound=Union[Callable[..., Any], type])
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def multimethod(*argtypes: KeyType) -> Callable[[T], MethodDispatcher[T]]:
|
||||
"""Declare method as multimethod.
|
||||
@ -82,7 +84,7 @@ class MethodDispatcher(FunctionDispatcher[T]):
|
||||
"""Process all unbound rule by binding them to ``cls`` type."""
|
||||
for argtypes, func in self.local.unbound_rules:
|
||||
argtypes = (cls,) + argtypes
|
||||
logging.info("register rule", argtypes)
|
||||
logger.debug("register rule", argtypes)
|
||||
self.register_rule(func, *argtypes)
|
||||
self.local.unbound_rules = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user