Files
crypto_okx/lib/common/flask_access_log_lib.py
dekun a1abe159fa Initial standalone crypto_okx with one-click deploy.
Add deploy/manage.sh bootstrap for git.bz121.com/dekun/crypto_okx and point docs at this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 20:00:59 +08:00

17 lines
526 B
Python

"""关闭 Flask/Werkzeug 开发服务器 access log 刷屏(避免灌满 PM2 error 日志)."""
from __future__ import annotations
import logging
def silence_werkzeug_access_log() -> None:
"""仅抑制 request access 行;WARNING/ERROR 仍可读."""
log = logging.getLogger("werkzeug")
log.setLevel(logging.WARNING)
# 部分环境会挂 StreamHandler 到 stderr;抬高阈值即可
for h in list(log.handlers):
try:
h.setLevel(logging.WARNING)
except Exception:
pass