diff --git a/caikit/core/exceptions/error_handler.py b/caikit/core/exceptions/error_handler.py index 29d4de2e6..1e503adfb 100644 --- a/caikit/core/exceptions/error_handler.py +++ b/caikit/core/exceptions/error_handler.py @@ -19,10 +19,13 @@ # Standard from collections.abc import Iterable from types import GeneratorType -from typing import TYPE_CHECKING, Dict, NoReturn, Optional, Type +from typing import TYPE_CHECKING, Dict, NoReturn, Optional, Type, Union import os import typing +# First Party +from alog.protocols import LoggerProtocol + # Local from caikit.config import get_config @@ -38,7 +41,7 @@ _error_handlers: Dict[str, "ErrorHandler"] = {} -def get(log_chan: "Logger"): +def get(log_chan: Union["Logger", LoggerProtocol]): """Get an error handler associated with a given alog log channel. The same error handler will be returned if this function is called repeatedly with the same log channel. @@ -61,7 +64,7 @@ class ErrorHandler: the `.log_raise` method. """ - def __init__(self, log_chan: "Logger"): + def __init__(self, log_chan: Union["Logger", LoggerProtocol]): """Create a new error handler that provides reusable error checking and automatic logging. Args: diff --git a/pyproject.toml b/pyproject.toml index dc2e52ba6..af3a1f399 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ classifiers=[ ] dependencies = [ "alchemy-config>=1.1.1,<2.0.0", - "alchemy-logging>=1.0.4,<2.0.0", + "alchemy-logging>=1.3.2,<2.0.0", "anytree>=2.7.0,<3.0", "docstring-parser>=0.14.1,<0.17.0", "grpcio>=1.35.0,<2.0,!=1.55.0",