I have the following code, copied from the Python manual:
import logging
LOG_FILENAME = 'example.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
logging.debug('This message should go to the log file')
|
I have the following code, copied from the Python manual:
|
解决办法:
You've got another module called logging
on the python path; probably a file logging.py
in the same directory. Compare print logging.__file__
.