Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Write Better Python Buggy Logs Logging

igsm '
igsm '
10,440 Points

level = logging.DEBUG?

Making reference to the video tutorial, I did not understand what does it mean when we specify level = logging.DEBUG and after we embed logging.info().

I understood that embed logging.info() records an info about user's steps in the game. But how is it related to level = logging.DEBUG? Why, for example, we did not set level = logging.INFO?

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

The level controls what level of message is actually captured by the logger. So if we set the level to INFO, any message below INFO (like, say, DEBUG), wouldn't be captured.