Skip to content

补充代理配置的arp#828

Open
ouzhuowei wants to merge 3 commits intoNanmiCoder:mainfrom
ouzhuowei:add_save_data_path
Open

补充代理配置的arp#828
ouzhuowei wants to merge 3 commits intoNanmiCoder:mainfrom
ouzhuowei:add_save_data_path

Conversation

@ouzhuowei
Copy link

@ouzhuowei ouzhuowei commented Feb 6, 2026

1、添加了代理相关配置的命令行参数支持

修改的文件

  • cmd_arg/arg.py
    • main() 函数中添加了三个代理相关的命令行参数
    • 添加了 enable_ip_proxy_value 的布尔值转换逻辑
    • 在配置覆盖部分添加了三个代理配置项的赋值

2、添加了日志存储配置和逻辑

  • config/base_config.py

    • 添加了三个日志配置项:LOG_SAVE_ENABLE(是否保存日志)、LOG_SAVE_PATH(日志保存路径)、LOG_SAVE_LEVEL(日志保存级别)
  • cmd_arg/arg.py

    • 添加了 LogLevelEnum 枚举类,定义日志级别(DEBUG、INFO、WARNING、ERROR、CRITICAL)
    • 在 main() 函数中添加了三个日志相关的命令行参数:
  • tools/utils.py

    • 修改了 init_loging_config() 函数,添加了日志文件保存功能
    • 添加了从 config.base_config 读取日志配置的逻辑(带异常处理)
    • 实现了日志目录自动创建功能(如果目录不存在)
    • 实现了按日期命名的日志文件(格式:mediacrawler-YYYY-MM-DD.log)
    • 添加了 RotatingFileHandler 文件处理器,支持日志文件轮转
    • 实现了日志级别的动态配置(根据 LOG_SAVE_LEVEL 设置文件日志级别)
    • 添加了异常处理,确保文件日志配置失败时不影响控制台日志输出

Co-Authored-By: ouzhuowei <190020754@qq.com>
@ouzhuowei ouzhuowei requested a review from NanmiCoder as a code owner February 6, 2026 02:03
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Feb 6, 2026
ouzhuowei added 2 commits February 6, 2026 12:24
Co-Authored-By: ouzhuowei <190020754@qq.com>
Co-Authored-By: ouzhuowei <190020754@qq.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant