| | |
| | | # 获取当前日期,并格式化为 'YYYY-MM-DD' |
| | | current_date = datetime.datetime.now().strftime('%Y-%m-%d') |
| | | # 声明要转义的文件的路径 |
| | | log_file_path = f'{constant.LOG_PATH}/transaction.{current_date}.log' |
| | | log_file_path = f'{constant.L2_LOG_PATH}/transaction.{current_date}.log' |
| | | # 检查文件是否存在,如果存在则继续处理,如果不存在则就此打住 |
| | | if not os.path.exists(log_file_path): |
| | | logger.info(f"Error错误:{log_file_path}----文件不存在!") |
| | |
| | | # print(f"没有找到这个货:{code}") |
| | | |
| | | |
| | | # 测试的时候可以调用一下 |
| | | find_L2_big_order_of_code('002384') |
| | | |
| | | # # 如果你需要将解析后的日志保存到新文件中,可以使用以下代码: |
| | | # output_file_path = 'path/to/your/parsed_logfile.txt' |
| | | # with open(output_file_path, 'w', encoding='utf-8') as output_file: |
| | | # for log in parsed_logs: |
| | | # output_file.write(log + '\n') |
| | | if __name__ == '__main__': |
| | | # 测试的时候可以调用一下 |
| | | find_L2_big_order_of_code('002384') |