MCPcopy
hub / github.com/HKUDS/LightRAG / filter

Method filter

lightrag/utils.py:378–402  ·  view source on GitHub ↗
(self, record)

Source from the content-addressed store, hash-verified

376 # self.filtered_paths = ["/health", "/webui/"]
377
378 def filter(self, record):
379 try:
380 # Check if record has the required attributes for an access log
381 if not hasattr(record, "args") or not isinstance(record.args, tuple):
382 return True
383 if len(record.args) < 5:
384 return True
385
386 # Extract method, path and status from the record args
387 method = record.args[1]
388 path = record.args[2]
389 status = record.args[4]
390
391 # Filter out successful GET/POST requests to filtered paths
392 if (
393 (method == "GET" or method == "POST")
394 and (status == 200 or status == 304)
395 and path in self.filtered_paths
396 ):
397 return False
398
399 return True
400 except Exception:
401 # In case of any error, let the message through
402 return True
403
404
405def setup_logger(

Callers 15

FileUploaderFunction · 0.45
onRemoveFunction · 0.45
AsyncSearchFunction · 0.45
AsyncSelectFunction · 0.45
GraphSearchInputFunction · 0.45
GraphLabelsFunction · 0.45
getModelRowsFunction · 0.45
ChatMessage.tsxFile · 0.45
getRecentSearchesMethod · 0.45
removeLabelMethod · 0.45
getStatsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected