修改命令行输出

This commit is contained in:
龙澳 2024-12-25 15:35:08 +08:00
parent 1393839ac8
commit cdea54e77a

View File

@ -60,12 +60,13 @@ class ODMProcessMonitor:
# 等待容器完成 # 等待容器完成
result = container.wait() result = container.wait()
# 只在失败时获取日志 # 只在失败时获取日志
if result['StatusCode'] != 0: if result['StatusCode'] != 0:
logs = container.logs().decode('utf-8') logs = container.logs().decode('utf-8')
self.logger.error(f"容器执行失败最后100行日志\n{''.join(logs.split('\n')[-100:])}") self.logger.error("容器执行失败最后10行日志")
self.logger.error(''.join(logs.split('\n')[-10:]))
# 检查是否成功完成 # 检查是否成功完成
if result['StatusCode'] == 0 and self._check_success(grid_dir): if result['StatusCode'] == 0 and self._check_success(grid_dir):
self.logger.info(f"网格 {grid_idx + 1} ODM处理成功") self.logger.info(f"网格 {grid_idx + 1} ODM处理成功")