优化日志
This commit is contained in:
@@ -235,7 +235,7 @@ class MemoryDeduplicator:
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f" ❌ 删除失败: {e}", exc_info=True)
|
||||
logger.error(f" ❌ 删除失败: {e}")
|
||||
self.stats["errors"] += 1
|
||||
return False
|
||||
|
||||
@@ -389,7 +389,7 @@ async def main():
|
||||
except KeyboardInterrupt:
|
||||
print("\n\n⚠️ 用户中断操作")
|
||||
except Exception as e:
|
||||
logger.error(f"执行失败: {e}", exc_info=True)
|
||||
logger.error(f"执行失败: {e}")
|
||||
print(f"\n❌ 执行失败: {e}")
|
||||
return 1
|
||||
finally:
|
||||
|
||||
@@ -183,7 +183,7 @@ async def generate_missing_embeddings(
|
||||
|
||||
except Exception as e:
|
||||
failed_count += len(batch)
|
||||
logger.error(f"批次 {batch_num} 处理失败", exc_info=True)
|
||||
logger.error(f"批次 {batch_num} 处理失败")
|
||||
print(f" ❌ 批次处理失败: {e}")
|
||||
|
||||
# 显示进度
|
||||
@@ -197,7 +197,7 @@ async def generate_missing_embeddings(
|
||||
await manager.persistence.save_graph_store(manager.graph_store)
|
||||
print("✅ 图数据已保存\n")
|
||||
except Exception as e:
|
||||
logger.error("保存图数据失败", exc_info=True)
|
||||
logger.error("保存图数据失败")
|
||||
print(f"❌ 保存失败: {e}\n")
|
||||
|
||||
# 5. 验证结果
|
||||
|
||||
@@ -424,7 +424,7 @@ def rebuild_faiss_only():
|
||||
embed_manager.save_to_file()
|
||||
logger.info("✅ FAISS 索引重建完成!")
|
||||
except Exception as e:
|
||||
logger.error(f"重建 FAISS 索引时发生错误: {e}", exc_info=True)
|
||||
logger.error(f"重建 FAISS 索引时发生错误: {e}")
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@@ -132,7 +132,7 @@ async def rebuild_metadata_index():
|
||||
print("\n✅ 元数据索引重建完成!")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"重建索引失败: {e}", exc_info=True)
|
||||
logger.error(f"重建索引失败: {e}")
|
||||
print(f"❌ 重建索引失败: {e}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user