> If you see people using requirements.txt in the wild instead of a poetry lock file or you see people using the decades-long broken python built-in logging framework instead of loguru you can see there’s opportunities for improvement everywhere
The irony of TFA mentioning the midwit meme.
50 iq - just use python's stdlib logger
100 iq - use loguru or some other custom log lib with fancy colors and formatting
150 iq - just use python's stdlib logger (with your own formatter)
Loguru is great for user-facing applications (especially when that user is a developer), it's pretty, structured out of the box, nice to use API. It's also pretty bloated and adds hundreds of ms of startup latency. Terrible for lambda/Faas cold starts.
Lately I've taken to just making a dict of the various field names and format strings, and json.dumps it into logging.basicConfig, boom, instant json structured logs. Middleware takes care of the rest. It Just Works(tm) and one of the most frustrating things is buggy loggers. The less overhead between `python3 /app` and getting some indicator everything is norminal, the better.
> don’t be bringing your outdated Python 3.7 sand castle to my Python 3.12 cathedral.
This is hilariously pretentious. Yeah 3.7 is EoL and if you're running it you probably need a kick in the pants to update deps, but it's far from the worst python sin.
The irony of TFA mentioning the midwit meme.
50 iq - just use python's stdlib logger
100 iq - use loguru or some other custom log lib with fancy colors and formatting
150 iq - just use python's stdlib logger (with your own formatter)
Loguru is great for user-facing applications (especially when that user is a developer), it's pretty, structured out of the box, nice to use API. It's also pretty bloated and adds hundreds of ms of startup latency. Terrible for lambda/Faas cold starts.
Lately I've taken to just making a dict of the various field names and format strings, and json.dumps it into logging.basicConfig, boom, instant json structured logs. Middleware takes care of the rest. It Just Works(tm) and one of the most frustrating things is buggy loggers. The less overhead between `python3 /app` and getting some indicator everything is norminal, the better.
> don’t be bringing your outdated Python 3.7 sand castle to my Python 3.12 cathedral.
This is hilariously pretentious. Yeah 3.7 is EoL and if you're running it you probably need a kick in the pants to update deps, but it's far from the worst python sin.