Skip to content

Conversation

@edgarrmondragon
Copy link

@edgarrmondragon edgarrmondragon commented Oct 18, 2025

The docs say about logging.LoggerAdapter:

An easy way in which you can pass contextual information to be output along with logging event information is to use the LoggerAdapter class. This class is designed to look like a Logger, so that you can call debug(), info(), warning(), error(), exception(), critical() and log(). These methods have the same signatures as their counterparts in Logger, so you can use the two types of instances interchangeably.

cc @jcbertin

Related

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 <jc.bertin@free.fr>
@edgarrmondragon edgarrmondragon force-pushed the fix/logger-adapter-maybe-logger branch from 40becb8 to f79a9d7 Compare October 18, 2025 02:11
@edgarrmondragon edgarrmondragon self-assigned this Oct 18, 2025
@edgarrmondragon edgarrmondragon changed the title fix: Added logging.LoggerAdapter to _MaybeLogger union fix: Added logging.LoggerAdapter to backoff._typing._MaybeLogger union Oct 22, 2025
@edgarrmondragon edgarrmondragon merged commit 74d0fb1 into main Oct 22, 2025
14 checks passed
@edgarrmondragon edgarrmondragon deleted the fix/logger-adapter-maybe-logger branch October 22, 2025 01:18
@edgarrmondragon edgarrmondragon added this to the v2.2.2 milestone Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants