File tree Expand file tree Collapse file tree
src/nypl_py_utils/functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
2+ ## v1.9.1 3/11/26
3+ - Add merge_contextvars to default structlog configuration
4+
25## v1.9.0 3/10/26
36- Add capability to upload arbitrary file type to S3
47
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44
55[project ]
66name = " nypl_py_utils"
7- version = " 1.9.0 "
7+ version = " 1.9.1 "
88authors = [
99 { name =" Aaron Friedman" , email =" aaronfriedman@nypl.org" },
1010]
Original file line number Diff line number Diff line change 1515# Configure structlog to be machine-readable first and foremost
1616# while still making it easy for humans to parse
1717# End result (without additional bindings) is JSON like this:
18- #
19- # { "logger": "module param"
20- # "message": "this is a test log event",
21- # "level": "info",
22- # "timestamp": "2023-11-01 18:50:47"}
23- #
18+ # {
19+ # "logger": "module param",
20+ # "message": "this is a test log event",
21+ # "level": "info",
22+ # "timestamp": "2023-11-01 18:50:47"
23+ # }
2424def get_structlog (module ):
2525 structlog .configure (
2626 processors = [
27+ structlog .contextvars .merge_contextvars ,
2728 structlog .processors .add_log_level ,
28- structlog .processors .TimeStamper (fmt = " iso" ),
29- structlog .processors .EventRenamer (" message" ),
29+ structlog .processors .TimeStamper (fmt = ' iso' ),
30+ structlog .processors .EventRenamer (' message' ),
3031 structlog .processors .JSONRenderer (),
3132 ],
3233 context_class = dict ,
You can’t perform that action at this time.
0 commit comments