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

Sahar Nasiri
Sahar Nasiri
7,454 Points

Why do we need logging?

Why can't we use comments on our code? they are not gonna be shown to player, or who runs the code!

Afrid Mondal
Afrid Mondal
6,255 Points

Logging is a means of tracking events that happen when some software runs. We adds logging to code to indicate that certain events have occurred. An event is described by a descriptive message which can optionally contain variable data(like event is starting or finished). You can say some kind of tracking of program, what is happening when some actions are happening. For more you can try https://docs.python.org/2/howto/logging.html

1 Answer

Sahar Nasiri
Sahar Nasiri
7,454 Points

I get it very well, Thanks :)