else: break except Exception: print >> sys.stderr, traceback.format_exc() raise Exception("read log file failed") finally: f.close() print >> sys.stderr, "{COLLECT LOG INFO END}" return "".join(ret) if __name__ == '__main__': topics = conf.get_topic_name().split(",") i = 0 path = log_config.getLogPath() # print str(topics) print "####TT2 TAILFILE HEALTH CHECK LIST####" for t in topics: print "{TOPIC " + t + "}" base_path = conf.get_base_path().split(",")[i] print "[SOURCE FILE BASE PATH]" print base_path path_regx = conf.get_path_regx().split(",")[i] print "[PATH REGULAR EXPRESSION]" print path_regx cp_path = conf.get_cp_path() cp_name = conf.get_cp_name().split(",")[i] i += 1 HealthCheck(path, cp_path, cp_name).check() print "" pass