logging
import logging
import time
logging.basicConfig(filename='demo_error.log', filemode="a+", level=logging.DEBUG)
try:
a = 1/0
print(a)
except:
logging.info(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
logging.exception('insert error')