mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2025-12-20 22:08:36 +00:00
feat(core): 集成日志记录功能以增强调试和错误处理
- 在多个模块中添加日志记录功能,替代原有的打印输出,提升调试信息的管理。 - 更新主窗口、下载管理器、离线模式管理器等,确保在关键操作中记录详细日志。 - 优化异常处理逻辑,确保在发生错误时能够记录相关信息,便于后续排查。 - 增强用户体验,通过日志记录提供更清晰的操作反馈和状态信息。
This commit is contained in:
17
source/utils/url_censor.py
Normal file
17
source/utils/url_censor.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import re
|
||||
|
||||
def censor_url(text):
|
||||
"""Censors URLs in a given text string, replacing them with a protection message.
|
||||
|
||||
Args:
|
||||
text: 要处理的文本
|
||||
|
||||
Returns:
|
||||
str: 处理后的文本,URL被完全隐藏
|
||||
"""
|
||||
if not isinstance(text, str):
|
||||
text = str(text)
|
||||
|
||||
# 匹配URL并替换为固定文本
|
||||
url_pattern = re.compile(r'https?://[^\s/$.?#].[^\s]*')
|
||||
return url_pattern.sub('***URL protection***', text)
|
||||
Reference in New Issue
Block a user