yangdx
commited on
Commit
·
268a7e2
1
Parent(s):
ab86a1f
Clean up logging output and remove redundant log messages
Browse files- gunicorn_config.py +0 -2
- lightrag/kg/networkx_impl.py +2 -4
- lightrag/kg/shared_storage.py +4 -4
gunicorn_config.py
CHANGED
@@ -61,9 +61,7 @@ def on_starting(server):
|
|
61 |
except ImportError:
|
62 |
print("psutil not installed, skipping memory usage reporting")
|
63 |
|
64 |
-
print("=" * 80)
|
65 |
print("Gunicorn initialization complete, forking workers...")
|
66 |
-
print("=" * 80)
|
67 |
|
68 |
|
69 |
def on_exit(server):
|
|
|
61 |
except ImportError:
|
62 |
print("psutil not installed, skipping memory usage reporting")
|
63 |
|
|
|
64 |
print("Gunicorn initialization complete, forking workers...")
|
|
|
65 |
|
66 |
|
67 |
def on_exit(server):
|
lightrag/kg/networkx_impl.py
CHANGED
@@ -92,8 +92,6 @@ class NetworkXStorage(BaseGraphStorage):
|
|
92 |
logger.info(
|
93 |
f"Loaded graph from {self._graphml_xml_file} with {preloaded_graph.number_of_nodes()} nodes, {preloaded_graph.number_of_edges()} edges"
|
94 |
)
|
95 |
-
else:
|
96 |
-
logger.info("Created new empty graph")
|
97 |
else:
|
98 |
preloaded_graph = NetworkXStorage.load_nx_graph(self._graphml_xml_file)
|
99 |
self._graph = preloaded_graph or nx.Graph()
|
@@ -101,8 +99,8 @@ class NetworkXStorage(BaseGraphStorage):
|
|
101 |
logger.info(
|
102 |
f"Loaded graph from {self._graphml_xml_file} with {preloaded_graph.number_of_nodes()} nodes, {preloaded_graph.number_of_edges()} edges"
|
103 |
)
|
104 |
-
|
105 |
-
|
106 |
|
107 |
self._node_embed_algorithms = {
|
108 |
"node2vec": self._node2vec_embed,
|
|
|
92 |
logger.info(
|
93 |
f"Loaded graph from {self._graphml_xml_file} with {preloaded_graph.number_of_nodes()} nodes, {preloaded_graph.number_of_edges()} edges"
|
94 |
)
|
|
|
|
|
95 |
else:
|
96 |
preloaded_graph = NetworkXStorage.load_nx_graph(self._graphml_xml_file)
|
97 |
self._graph = preloaded_graph or nx.Graph()
|
|
|
99 |
logger.info(
|
100 |
f"Loaded graph from {self._graphml_xml_file} with {preloaded_graph.number_of_nodes()} nodes, {preloaded_graph.number_of_edges()} edges"
|
101 |
)
|
102 |
+
|
103 |
+
logger.info("Created new empty graph")
|
104 |
|
105 |
self._node_embed_algorithms = {
|
106 |
"node2vec": self._node2vec_embed,
|
lightrag/kg/shared_storage.py
CHANGED
@@ -107,9 +107,9 @@ def try_initialize_namespace(namespace: str) -> bool:
|
|
107 |
|
108 |
if namespace not in _init_flags:
|
109 |
_init_flags[namespace] = True
|
110 |
-
direct_log(f"Process {os.getpid()} ready to initialize namespace {namespace}")
|
111 |
return True
|
112 |
-
direct_log(f"Process {os.getpid()}
|
113 |
return False
|
114 |
|
115 |
|
@@ -146,7 +146,7 @@ def get_namespace_object(namespace: str) -> Any:
|
|
146 |
else:
|
147 |
_share_objects[namespace] = None
|
148 |
direct_log(
|
149 |
-
f"Created namespace
|
150 |
)
|
151 |
|
152 |
return _share_objects[namespace]
|
@@ -169,7 +169,7 @@ def get_namespace_data(namespace: str) -> Dict[str, Any]:
|
|
169 |
else:
|
170 |
_shared_dicts[namespace] = {}
|
171 |
direct_log(
|
172 |
-
f"Created namespace
|
173 |
)
|
174 |
|
175 |
return _shared_dicts[namespace]
|
|
|
107 |
|
108 |
if namespace not in _init_flags:
|
109 |
_init_flags[namespace] = True
|
110 |
+
direct_log(f"Process {os.getpid()} ready to initialize storage namespace: [{namespace}]")
|
111 |
return True
|
112 |
+
direct_log(f"Process {os.getpid()} storage namespace already to initialized: [{namespace}]")
|
113 |
return False
|
114 |
|
115 |
|
|
|
146 |
else:
|
147 |
_share_objects[namespace] = None
|
148 |
direct_log(
|
149 |
+
f"Created namespace: {namespace}(type={type(_share_objects[namespace])})"
|
150 |
)
|
151 |
|
152 |
return _share_objects[namespace]
|
|
|
169 |
else:
|
170 |
_shared_dicts[namespace] = {}
|
171 |
direct_log(
|
172 |
+
f"Created namespace: {{namespace}}({type(_shared_dicts[namespace])}) "
|
173 |
)
|
174 |
|
175 |
return _shared_dicts[namespace]
|