Mysterious logging.basicConfig problem (Python)
Posted
by Max
on Stack Overflow
See other posts from Stack Overflow
or by Max
Published on 2010-05-14T09:48:58Z
Indexed on
2010/05/14
9:54 UTC
Read the original article
Hit count: 182
I'm writing a Python script to retrieve data from Flickr. For logging purposes, I have the following setup function:
def init_log(logfile):
format = '%(asctime)s - %(levelname)s - %(message)s'
logging.basicConfig(filename=logfile,level=logging.DEBUG,format=format)
I've tested this using the python shell and it works as expected, creating a file if one doesn't already exist. But calling it from within my program is where it stops working. The function is definitely being called, and the logfile
parameter is working properly – logging.basicConfig
just isn't creating any file. I'm not even getting any errors or warnings.
My use of the Python Flickr API may be the culprit, but I doubt it. Any ideas?
© Stack Overflow or respective owner