chore: 输出日志增加占位符

This commit is contained in:
CaptainB 2024-02-21 17:48:54 +08:00 committed by 刘瑞斌
parent 42c1e54d80
commit aa910bc55d
6 changed files with 9 additions and 9 deletions

View File

@ -50,7 +50,7 @@ public class MinioRepository implements FileRepository {
try {
Object serverUrl = minioConfig.get(ENDPOINT).toString();
if (ObjectUtils.isNotEmpty(serverUrl)) {
LogUtils.info("开始初始化MinIO插件。配置", PluginUtils.toJSONString(minioConfig));
LogUtils.info("开始初始化MinIO插件。配置{}", PluginUtils.toJSONString(minioConfig));
// 创建 MinioClient 客户端
client = MinioClient.builder()
.endpoint(minioConfig.get(ENDPOINT).toString())

View File

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

View File

@ -20,13 +20,13 @@ public class DebugListener {
@KafkaListener(id = DEBUG_CONSUME_ID, topics = KafkaTopicConstants.API_REPORT_DEBUG_TOPIC, groupId = DEBUG_CONSUME_ID + "_" + "${random.uuid}")
public void debugConsume(ConsumerRecord<?, String> record) {
try {
LogUtils.info("接收到执行结果:", record.key());
LogUtils.info("接收到执行结果:{}", record.key());
if (ObjectUtils.isNotEmpty(record.value()) && WebSocketUtils.has(record.key().toString())) {
SocketMsgDTO dto = JSON.parseObject(record.value(), SocketMsgDTO.class);
WebSocketUtils.sendMessageSingle(dto);
}
} catch (Exception e) {
LogUtils.error("调试消息推送失败:", e);
LogUtils.error("调试消息推送失败:{}", e);
}
}
}

View File

@ -32,7 +32,7 @@ public class MessageListener {
@KafkaListener(id = MESSAGE_CONSUME_ID, topics = KafkaTopicConstants.API_REPORT_TASK_TOPIC, groupId = MESSAGE_CONSUME_ID)
public void messageConsume(ConsumerRecord<?, String> record) {
try {
LogUtils.info("接收到发送通知信息:", record.key());
LogUtils.info("接收到发送通知信息:{}", record.key());
if (ObjectUtils.isNotEmpty(record.value())) {
ApiNoticeDTO dto = JSON.parseObject(record.value(), ApiNoticeDTO.class);
@ -40,7 +40,7 @@ public class MessageListener {
if (!StringUtils.equalsIgnoreCase(dto.getReportType(), ApiReportType.INTEGRATED.name())) {
apiReportSendNoticeService.sendNotice(dto);
// TODO 通知测试计划处理后续
LogUtils.info("发送通知给测试计划:", record.key());
LogUtils.info("发送通知给测试计划:{}", record.key());
apiEventSource.fireEvent(ApplicationScope.API_TEST, record.value());
}
@ -50,7 +50,7 @@ public class MessageListener {
}
} catch (Exception e) {
LogUtils.error("接收到发送通知信息:", e);
LogUtils.error("接收到发送通知信息:{}", e);
}
}
}

View File

@ -40,7 +40,7 @@ public class ApiPluginChangeService implements PluginChangeService {
.forEach(item -> JmeterElementConverterRegister.register((Class<? extends AbstractJmeterElementConverter<? extends MsTestElement>>) item));
}
} catch (Exception e) {
LogUtils.error("注册接口插件实现类失败:", e);
LogUtils.error("注册接口插件实现类失败:{}", e);
}
}
}

View File

@ -270,7 +270,7 @@ public class OperationLogAspect {
save(result);
}
} catch (Exception e) {
LogUtils.error("操作日志写入异常:", e);
LogUtils.error("操作日志写入异常:{}", e);
} finally {
localUser.remove();
beforeValues.remove();