logging.basicConfig(filename=LOG, filemode='w', level=logging.DEBUG)
console = logging.StreamHandler()
console.setLevel(logging.ERROR)
logging.getLogger('').addHandler(console)
writing a log file from python program