MCPcopy Create free account
hub / github.com/NatsUIJM/autoContents / write_log

Function write_log

mainprogress/pdf_metadata_extractor.py:26–33  ·  view source on GitHub ↗

写入日志到项目根目录的 log.txt

(message)

Source from the content-addressed store, hash-verified

24sys.path.append(PROJECT_ROOT)
25
26def write_log(message):
27 """写入日志到项目根目录的 log.txt"""
28 try:
29 log_file = Path(PROJECT_ROOT) / "log.txt"
30 with open(log_file, "a", encoding="utf-8") as f:
31 f.write(f"[{threading.current_thread().name}] {message}\n")
32 except Exception as e:
33 print(f"日志写入失败:{e}")
34
35# 配置日志输出到标准输出
36logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s', stream=sys.stdout)

Callers 9

create_concat_image_b64Function · 0.70
fetch_toc_from_imageFunction · 0.70
parse_toc_jsonFunction · 0.70
extract_toc_infoFunction · 0.70
extract_book_nameFunction · 0.70
fetch_single_offsetFunction · 0.70
calculate_offsetFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected