feat: 启用杨浩功能并调整日志时间戳设置为系统时间
This commit is contained in:
1 parent
575d6f3fd5
commit
8d31e0ba1a
5 files changed
+41
-27
No files matched your search
@@ -174,19 +174,9 @@ class LoggingWrapper:
|
||||
except Exception:
|
||||
analyser._log_seq = 1
|
||||
|
||||
# 获取时间戳
|
||||
# 获取时间戳(使用系统时间)
|
||||
try:
|
||||
# 检查是否启用真实时间戳(显示实际年份而不是系统时间)
|
||||
use_real_timestamp = getattr(analyser, "_use_real_timestamp", False)
|
||||
if use_real_timestamp:
|
||||
# 使用真实时间:获取当前实际年份,但保持其他时间部分
|
||||
now = datetime.now()
|
||||
# 假设真实年份是2024(可以根据需要调整)
|
||||
real_year = 2024
|
||||
real_now = now.replace(year=real_year)
|
||||
timestamp = real_now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
|
||||
else:
|
||||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
|
||||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
|
||||
except Exception:
|
||||
# 如果无法导入 datetime(极少见),回退为 time.strftime
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user