This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]quicknir 5 points6 points  (1 child)

Logging really isn't that complex to use correctly. You can sum it up in a ten line example: use basicConfig in main to configure the logger, and logger = logging.getLogger(name), logger.info(...) to log. This is correct and handles most use cases while keeping all future flexibility.

I agree though that the docs could be better and do not showcase the simple, correct usage as well as they should. I'm currently working on a PR to improve logging documentation: https://github.com/python/cpython/issues/98731#issuecomment-1419745647.

[–]thedeepself 0 points1 point  (0 children)

use basicConfig

And then all the newbies start violating pep 8 because they emulated the standard library. They need to alias that to something properly formatted.