import logging
from logging import info, basicConfig, INFO

format ='%(levelname)s:%(name)s:%(message)s' 
basicConfig(filename='out.log', level=INFO, format=format)
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
formatter = logging.Formatter(format)
console.setFormatter(formatter)
logging.getLogger('').addHandler(console)


info("logging to console and file")



