MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_log

Method get_log

mod/project/python/serviceMod.py:274–283  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

272 pass
273
274 def get_log(self) -> str:
275 if not self.env:
276 raise RuntimeError('未设置环境')
277 log_file = os.path.join(SERVICE_PATH, '{}/{}.log'.format(self.env.project_name, self.name))
278 if not os.path.isfile(log_file):
279 return '暂无日志'
280 data = public.GetNumLines(log_file, 1000)
281 if not data:
282 return '暂无日志'
283 return data
284
285 @staticmethod
286 def _get_ports_by_pid(pid: int) -> List[int]:

Callers 1

get_service_logMethod · 0.45

Calls 3

GetNumLinesMethod · 0.80
joinMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected