def inner(config, logfile, *args): if isinstance(config, str): conf_file = config config = ConfigParser() config.readfp(open(conf_file)) logger.start(logfile=logfile) sourcefile = inspect.getabsfile(main) logger.info('*** Starting logger ***') logger.info('*** Running file %s ***' % sourcefile) try: main(config, logfile, *args) except: logger.exception("Unexpected Error.") logger.info('*** Leaving file %s ***' % sourcefile) logger.info('*** Stopping logger ***') logger.end()
def exit(self): try: log.end() except: pass