Skip to content

Commit

Permalink
Add an explaining comment to ExtraAdder (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
aucampia authored Dec 11, 2021
1 parent 9446227 commit 51132d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/structlog/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ class ExtraAdder:
def __init__(self, allow: Optional[Collection[str]] = None) -> None:
self._copier: Callable[[EventDict, logging.LogRecord], None]
if allow is not None:
# The contents of allow is copied to a new list so that changes to
# the list passed into the constructor does not change the
# behaviour of this processor.
self._copier = functools.partial(self._copy_allowed, [*allow])
else:
self._copier = self._copy_all
Expand Down

0 comments on commit 51132d5

Please sign in to comment.