refactor(接口测试): 优化部分日志输出

This commit is contained in:
fit2-zhao 2022-03-07 14:54:21 +08:00 committed by fit2-zhao
parent cd41d140e1
commit f9fa51dd6e
7 changed files with 9 additions and 9 deletions

View File

@ -109,7 +109,7 @@ public class ExecThreadPoolExecutor {
threadPool.allowCoreThreadTimeOut(true);
LoggerUtil.info("AllCoreThreads: " + threadPool.prestartAllCoreThreads());
} catch (Exception e) {
LoggerUtil.error("设置线程参数异常:" + e);
LoggerUtil.error("设置线程参数异常:", e);
}
}

View File

@ -134,7 +134,7 @@ public class ApiScenarioSerialService {
ResultDTO dto = new ResultDTO();
BeanUtils.copyBean(dto, runRequest);
CommonBeanFactory.getBean(ApiExecutionQueueService.class).queueNext(dto);
LoggerUtil.error("执行终止:" + e.getMessage());
LoggerUtil.error("执行终止:", e);
}
}

View File

@ -129,7 +129,7 @@ public class JMeterService {
final Engine engine = EngineFactory.createApiEngine(request);
engine.start();
} catch (Exception e) {
LoggerUtil.error("调用K8S执行请求[ " + request.getTestId() + " ] 失败:" + e.getMessage());
LoggerUtil.error("调用K8S执行请求[ " + request.getTestId() + " ] 失败:", e);
ApiScenarioReportService apiScenarioReportService = CommonBeanFactory.getBean(ApiScenarioReportService.class);
apiScenarioReportService.delete(request.getReportId());
MSException.throwException(e.getMessage());
@ -171,7 +171,7 @@ public class JMeterService {
} catch (Exception e) {
RemakeReportService remakeReportService = CommonBeanFactory.getBean(RemakeReportService.class);
remakeReportService.remake(request);
LoggerUtil.error("发送请求[ " + request.getTestId() + " ] 执行失败:" + e.getMessage());
LoggerUtil.error("发送请求[ " + request.getTestId() + " ] 执行失败:", e);
LoggerUtil.error(e);
}
}

View File

@ -135,7 +135,7 @@ public class MsDebugListener extends AbstractListenerElement implements SampleLi
LoggerUtil.debug("send. " + this.getName());
WebSocketUtils.sendMessageSingle(dto);
} catch (Exception ex) {
LoggerUtil.error("消息推送失败:" + ex.getMessage());
LoggerUtil.error("消息推送失败:" , ex);
}
}

View File

@ -93,7 +93,7 @@ public class MsKafkaListener {
});
}
} catch (Exception e) {
LoggerUtil.error("KAFKA消费失败" + e.getMessage());
LoggerUtil.error("KAFKA消费失败", e);
} finally {
ack.acknowledge();
}
@ -121,7 +121,7 @@ public class MsKafkaListener {
return element;
}
} catch (Exception e) {
LoggerUtil.error("formatResult 格式化数据失败:" + e.getMessage());
LoggerUtil.error("formatResult 格式化数据失败:", e);
}
return null;
}

View File

@ -118,7 +118,7 @@ public class ApiEnvironmentRunningParamService {
}
} catch (Exception ex) {
LoggerUtil.error("设置环境变量异常" + ex.getMessage());
LoggerUtil.error("设置环境变量异常", ex);
}
}

View File

@ -50,7 +50,7 @@ public class WebSocketUtils {
WebSocketUtils.ONLINE_USER_SESSIONS.remove(("send." + reportId));
}
} catch (Exception e) {
LoggerUtil.error("关闭socket失败" + e.getMessage());
LoggerUtil.error("关闭socket失败", e);
}
}
}