adjust logging system (#51)

* remove ruff comment in log.py

* change log framework and fix llm_utils.py's logs

* Some thoughts for logging

* fix SingletonMeta's definition, maintain an instance dict for each class that inherits it

* adjust log codes directory, add some tag for factor implementation logging

* Update rdagent/core/conf.py

* fix factor task app & log

* fix log import

* Streamlet framework

* fix log tag to path logic

* Add todos

* Add example in docstring

* add log tag for llm_utils.py

* Capture lost content

---------

Co-authored-by: Young <afe.young@gmail.com>
Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
This commit is contained in:
XianBW
2024-07-16 20:35:42 +08:00
committed by GitHub
parent f4e1975b3d
commit eee2b3c56a
27 changed files with 532 additions and 228 deletions
@@ -28,7 +28,7 @@ from rdagent.core.evolving_framework import (
RAGStrategy,
)
from rdagent.core.experiment import Implementation
from rdagent.core.log import RDAgentLog
from rdagent.log import rdagent_logger as logger
from rdagent.core.prompts import Prompts
from rdagent.oai.llm_utils import (
APIBackend,
@@ -336,7 +336,7 @@ class FactorGraphRAGStrategy(RAGStrategy):
)["component_no_list"]
return [all_component_nodes[index - 1] for index in sorted(list(set(component_no_list)))]
except:
RDAgentLog().warning("Error when analyzing components.")
logger.warning("Error when analyzing components.")
analyze_component_user_prompt = "Your response is not a valid component index list."
return []
@@ -714,7 +714,7 @@ class FactorGraphKnowledgeBase(KnowledgeBase):
Load knowledge, offer brief information of knowledge and common handle interfaces
"""
self.graph: UndirectedGraph = UndirectedGraph.load(Path.cwd() / "graph.pkl")
RDAgentLog().info(f"Knowledge Graph loaded, size={self.graph.size()}")
logger.info(f"Knowledge Graph loaded, size={self.graph.size()}")
if init_component_list:
for component in init_component_list: