获取项目日志api @author baozi <202-02-22> @param: get ( dict ): 请求信息,需要包含项目名称 @return msg : 日志信息
(self, get)
| 1596 | return log_file |
| 1597 | |
| 1598 | def GetProjectLog(self, get): |
| 1599 | """获取项目日志api |
| 1600 | @author baozi <202-02-22> |
| 1601 | @param: |
| 1602 | get ( dict ): 请求信息,需要包含项目名称 |
| 1603 | @return msg : 日志信息 |
| 1604 | """ |
| 1605 | project_conf = self._get_project_conf(get.name.strip()) |
| 1606 | if not project_conf: return public.returnMsg(False, '项目不存在') |
| 1607 | log_file = self._project_logfile(project_conf) |
| 1608 | if not os.path.exists(log_file): |
| 1609 | return public.returnMsg(False, '日志文件不存在') |
| 1610 | log_file_size = os.path.getsize(log_file) |
| 1611 | if log_file_size > 3145928: |
| 1612 | return {"status": True, "path": log_file, "data": self.xsssec(self.last_lines(log_file, 3000)), |
| 1613 | "size": public.to_size(log_file_size)} |
| 1614 | return {"status": True, "path": log_file, "data": self.xsssec(public.GetNumLines(log_file, 3000)), |
| 1615 | "size": public.to_size(log_file_size)} |
| 1616 | |
| 1617 | |
| 1618 | def GetProjectList(self, get): |
no test coverage detected