feat: generate_report简报记录统一日志(daily_brief.log)——开盘/收盘简报内容记录到gateway/logs/daily_brief.log,方便溯源
This commit is contained in:
@@ -151,5 +151,18 @@ def main():
|
||||
}
|
||||
print(json.dumps(param_table, ensure_ascii=False, indent=2))
|
||||
|
||||
# 2026-08-14 通道统一:简报内容记录到统一日志(daily_brief.log),方便溯源
|
||||
try:
|
||||
from datetime import datetime as _dt
|
||||
_log_dir = Path("/home/hmo/MoFin/gateway/logs")
|
||||
_log_dir.mkdir(parents=True, exist_ok=True)
|
||||
_brief_log = _log_dir / "daily_brief.log"
|
||||
with open(_brief_log, "a", encoding="utf-8") as _f:
|
||||
_f.write(f"\n=== {_dt.now().strftime('%Y-%m-%d %H:%M:%S')} {report_type} ===\n")
|
||||
_f.write(filled)
|
||||
_f.write("\n")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user