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 Log Messages

Shane Smith
seal-mask
.a{fill-rule:evenodd;}techdegree
Shane Smith
Python Development Techdegree Student 2,550 Points

Struggling to understand what this is asking me to do?

I dont understand what the question is asking of me.

starter.py
import logging

logging.basicConfig(filename='cc.log', level=logging.DEBUG)

# Write your code below here

1 Answer

Rick Gleitz
Rick Gleitz
47,197 Points

Hi Shane,

It's asking you to log a message at the debug level, which will go into the file cc.log. You do this by literally typing:

logging.debug("and you put any string in here that you want")

And that's basically it!

It would help your understanding if you re-watch the previous video. Kenneth logs a more complicated string at about the five minute mark (he uses logging.info, though). But it's worth it to watch the whole video again.

Hope this helps!