def setup_logger(logger, fname, stream=True, mode=logging.ERROR):
    path = os.path.join(ETSConfig.application_home, fname)
    handler = LogFileHandler(path)
    logger.addHandler(handler)
    if stream:
        s = logging.StreamHandler()
        s.setFormatter(FORMATTER)
        s.setLevel(mode)
        logger.addHandler(s)
    logger.info("*"*80)
    logger.info("logfile is: '%s'", os.path.abspath(path))
    logger.info("*"*80)
Setup a log file and the logger in `ETSConfig.application_home`.
dataset/ETHPy150Open enthought/mayavi/examples/tvtk/plugins/test.py/setup_logger