MCPcopy
hub / github.com/InternLM/lmdeploy / ProcessContextFilter

Class ProcessContextFilter

lmdeploy/utils.py:113–123  ·  view source on GitHub ↗

Inject process context fields used by log formatter.

Source from the content-addressed store, hash-verified

111
112
113class ProcessContextFilter(logging.Filter):
114 """Inject process context fields used by log formatter."""
115
116 def __init__(self, name: str = 'lmdeploy'):
117 super().__init__(name)
118
119 def filter(self, record: LogRecord) -> bool:
120 # `ppid` is not a builtin LogRecord attribute, inject it so logs from
121 # parent api_server and child executor processes can be correlated.
122 record.ppid = os.getppid()
123 return True
124
125
126_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(filename)s:%(lineno)d' \

Callers 1

get_loggerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected