Initial commit: snapAna 截图智能整理工具

包含 FastAPI 后端、React 前端、队列/OCR/标签/待办等完整功能。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wjl
2026-05-27 15:45:50 +08:00
commit 5c028d7952
76 changed files with 10467 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"""统一日志配置。"""
from __future__ import annotations
import logging
import sys
def setup_logging(debug: bool = False) -> None:
"""初始化根 logger 的格式与级别。"""
level = logging.DEBUG if debug else logging.INFO
fmt = "%(asctime)s | %(levelname)-7s | %(name)s | %(message)s"
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter(fmt))
root = logging.getLogger()
root.handlers.clear()
root.addHandler(handler)
root.setLevel(level)
# 降低第三方库噪音
for noisy in ("watchdog", "httpx", "PIL"):
logging.getLogger(noisy).setLevel(logging.WARNING)
def get_logger(name: str) -> logging.Logger:
"""统一入口获取 logger。"""
return logging.getLogger(name)