Skip to content

Commit 40becb8

Browse files
fix: Added logging.LoggerAdapter to _MaybeLogger union
The docs say about `logging.LoggerAdapter`: <blockquote> An easy way in which you can pass contextual information to be output along with logging event information is to use the [`LoggerAdapter`](https://docs.python.org/3/library/logging.html#logging.LoggerAdapter) class. This class is designed to look like a [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger), so that you can call [`debug()`](https://docs.python.org/3/library/logging.html#logging.debug), [`info()`](https://docs.python.org/3/library/logging.html#logging.info), [`warning()`](https://docs.python.org/3/library/logging.html#logging.warning), [`error()`](https://docs.python.org/3/library/logging.html#logging.error), [`exception()`](https://docs.python.org/3/library/logging.html#logging.exception), [`critical()`](https://docs.python.org/3/library/logging.html#logging.critical) and [`log()`](https://docs.python.org/3/library/logging.html#logging.log). These methods have the same signatures as their counterparts in [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger), so you can use the two types of instances interchangeably. </blockquote> Co-authored-by: Jean-Charles BERTIN <[email protected]>
1 parent a0dc886 commit 40becb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backoff/_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Details(_Details, total=False):
3838
]
3939
_Jitterer = Callable[[float], float]
4040
_MaybeCallable = Union[T, Callable[[], T]]
41-
_MaybeLogger = Union[str, logging.Logger, None]
41+
_MaybeLogger = Union[str, logging.Logger, logging.LoggerAdapter, None]
4242
_MaybeSequence = Union[T, Sequence[T]]
4343
_Predicate = Callable[[T], bool]
4444
_WaitGenerator = Callable[..., Generator[float, None, None]]

0 commit comments

Comments
 (0)