- Removed excessive blank lines from various markdown and Python files to enhance readability and maintainability. - Ensured consistent formatting across documentation and code files, improving overall project clarity.
76 lines
833 B
Python
76 lines
833 B
Python
# -*- coding: utf-8 -*-
|
|
"""最终测试日志写入"""
|
|
import douyin_logging
|
|
douyin_logging.configure_logging()
|
|
|
|
from douyin_fudai import fudai_analyse
|
|
import logging
|
|
import time
|
|
|
|
root = logging.getLogger()
|
|
print(f"Root logger handlers: {len(root.handlers)}")
|
|
|
|
a = fudai_analyse()
|
|
a._log_kv("GUI测试", "这是来自GUI的测试日志", test_field="test_value")
|
|
|
|
time.sleep(0.5)
|
|
|
|
# 读取日志文件
|
|
from datetime import datetime
|
|
today = datetime.now().strftime("%Y-%m-%d")
|
|
log_file = f"logs/unified_{today}.log"
|
|
|
|
import os
|
|
if os.path.exists(log_file):
|
|
with open(log_file, 'r', encoding='utf-8') as f:
|
|
lines = f.readlines()
|
|
print(f"Log file lines: {len(lines)}")
|
|
print("Last 3 lines:")
|
|
for line in lines[-3:]:
|
|
print(f" {line.rstrip()}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|