Administrator
2023-08-17 15569edd9fc054c0cdac5279e0a346a64f058963
删除redis日志与时间日志
2个文件已修改
14 ■■■■■ 已修改文件
huaxin_api/l1_client.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
log_module/log.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_api/l1_client.py
@@ -162,13 +162,13 @@
def run(pipe_l2):
    logger_local_huaxin_l1.info("运行l1订阅服务")
    time.sleep(10)
    codes_sh = []
    codes_sz = []
    for i in range(3):
    for i in range(10):
        try:
            codes_sh, codes_sz = get_level1_codes()
            logger_local_huaxin_l1.info(f"获取上证,深证代码数量:sh-{len(codes_sh)} sz-{len(codes_sz)}")
            break
        except Exception as e:
            logger_local_huaxin_l1.exception(e)
            time.sleep(4)
log_module/log.py
@@ -226,7 +226,6 @@
        logger.add(sys.stdout,
                   filter=lambda record: record["extra"].get("name") == "local_huaxin_l1_show_info")
    def get_path(self, dir_name, log_name):
        path_str = "{}/logs/gp/{}/{}".format(constant.get_path_prefix(), dir_name, log_name) + ".{time:YYYY-MM-DD}.log"
        # print(path_str)
@@ -332,15 +331,12 @@
logger_local_huaxin_l1 = __mylogger.get_logger("local_huaxin_l1_show_info")
def close_print():
    pass
    # logging.basicConfig(level=logging.ERROR)
    # if not constant.is_windows():
    #     os.close(1)
    #     os.open('/dev/null', os.O_WRONLY)
    if not constant.is_windows():
        os.close(1)
        os.open('/dev/null', os.O_WRONLY)
if __name__ == "__main__":