Skip to content

Commit

Permalink
Remove deprecated use of structlog's wrap_dict
Browse files Browse the repository at this point in the history
We aren't calling a logger's `new()`, `bind()` or `unbind()` methods,
so assuming this is unused.

It was originally copied over from cohort-extractor, for which the code
was initially added a while ago.

The current way of doing things if this is needed is to use
`contextvars`:

```python
structlog.contextvars.bind_contextvars()
structlog.contextvars.unbind_contextvars()
```

https://www.structlog.org/en/22.3.0/thread-local.html
https://www.structlog.org/en/22.3.0/contextvars.html
  • Loading branch information
StevenMaude committed Mar 16, 2023
1 parent 12c4f5b commit 139e98c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion databuilder/utils/log_utils.py
Expand Up @@ -21,7 +21,6 @@
structlog.processors.UnicodeDecoder(),
structlog.stdlib.ProcessorFormatter.wrap_for_formatter,
],
context_class=structlog.threadlocal.wrap_dict(dict),
logger_factory=structlog.stdlib.LoggerFactory(),
wrapper_class=structlog.stdlib.BoundLogger,
cache_logger_on_first_use=True,
Expand Down

0 comments on commit 139e98c

Please sign in to comment.