Spent a bunch of time choosing between Loguru, Structlog and native logging

Posted by rm-rf-rm@reddit | Python | View on Reddit | 28 comments

Python's native logging module is just fine but modern options like Loguru and Structlog are eye-catching. As someone who wants to use the best tooling so that I can make my life easy, I agonized over choosing one.. perhaps a little too much (I'd rather expend calories now rather than being in production hell and trying to wrangle logs).

I've boiled down what I've learnt to the following:

So my recommendation is:

The one trade off is that loguru/structlog have good exception/stack trace handling capabilities built in. With native logging, you'll need to write more code and for this case, AI coding may get hairy.

P.S: Im yet to integrate into a log aggregation service (aiming at Signoz) so we'll have to wait and see how this decision pays off.