import logging
import logging.config
logging.basicConfig(filename='mylog.txt', level=logging.ERROR)
logging.error("There isan error in the program.")
logging.critical("There is a problem in the design.")
logging.warning("The project isgoing slow.")
logging.info("You are a junior programmer.")
logging.debug("Line no. 10 conrains syntax error.")
ERROR:
Error:
Traceback (most recent call last):
File "C:\Users\rahul\Desktop\Python-workspace\Test\error_log1.py", line 6, in <module>
import logging
File "C:\Users\rahul\Desktop\Python-workspace\Test\logging.py", line 9, in <module>
logging.basicConfig(filename='mylog.txt', level=logging.ERROR)
AttributeError: module 'logging' has no attribute 'basicConfig'