if __name__ == '__main__':
    logger.setLevel(logging.DEBUG)
console = logging.StreamHandler()
console.setFormatter(ColoredFormatter(
    '%(name)s: %(message)s (%(filename)s:%(lineno)d)'))
logger.addHandler(console)
fh = logging.FileHandler('/tmp/test.log', 'w')
fh.setFormatter(logging.Formatter('%(name)s: %(message)s'))
logger.addHandler(fh)
logger.debug('debug')
logger.info('info')
logger.warning('Warning')
logger.error('ERROR')
logger.critical('CRITICAL!!!')
print colorful string out to console with python