Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logging tutorial
#1
Hi all,

The web contains a tremendous amount of "in-depth guide to Python logging". It therefore becomes very easy to find one part of the information about logging: how to configure it. But how to use it?

I do not ask how to use getLogger and similar functions, but where to place them, and how to choose the level on a software engineering side. While info, error, and critical look easy to place (but are they?), I have no idea what are the best practices regarding debug. Shall I add one at the beginning and end of every method? Every second line?

I'm just looking for a guide on this matter, being a PEP, recommendations from a large project, or any document from a quality source.

Thanks in advance!
Duna
Reply
#2
A very good introduction to python's standard library modules is usually Doug Hellmann's pymotw3 series. Check it first.
Reply
#3
Thanks Gribouillis for the link. Unfortunately, this documentation is pretty similar to what I can see somewhere else. It explains very well how to configure and use it, but not when and where to use it.

I guess what I'm looking for is closer to a best practice than really a tutorial.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020