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 { try {
Object serverUrl = minioConfig.get(ENDPOINT).toString(); Object serverUrl = minioConfig.get(ENDPOINT).toString();
if (ObjectUtils.isNotEmpty(serverUrl)) { if (ObjectUtils.isNotEmpty(serverUrl)) {
LogUtils.info("开始初始化MinIO插件。配置", PluginUtils.toJSONString(minioConfig)); LogUtils.info("开始初始化MinIO插件。配置{}", PluginUtils.toJSONString(minioConfig));
// 创建 MinioClient 客户端 // 创建 MinioClient 客户端
client = MinioClient.builder() client = MinioClient.builder()
.endpoint(minioConfig.get(ENDPOINT).toString()) .endpoint(minioConfig.get(ENDPOINT).toString())

View File

@ -51,7 +51,7 @@ public class WebSocketUtils {
WebSocketUtils.ONLINE_USER_SESSIONS.remove(reportId); WebSocketUtils.ONLINE_USER_SESSIONS.remove(reportId);
} }
} catch (Exception e) { } 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}") @KafkaListener(id = DEBUG_CONSUME_ID, topics = KafkaTopicConstants.API_REPORT_DEBUG_TOPIC, groupId = DEBUG_CONSUME_ID + "_" + "${random.uuid}")
public void debugConsume(ConsumerRecord<?, String> record) { public void debugConsume(ConsumerRecord<?, String> record) {
try { try {
LogUtils.info("接收到执行结果:", record.key()); LogUtils.info("接收到执行结果:{}", record.key());
if (ObjectUtils.isNotEmpty(record.value()) && WebSocketUtils.has(record.key().toString())) { if (ObjectUtils.isNotEmpty(record.value()) && WebSocketUtils.has(record.key().toString())) {
SocketMsgDTO dto = JSON.parseObject(record.value(), SocketMsgDTO.class); SocketMsgDTO dto = JSON.parseObject(record.value(), SocketMsgDTO.class);
WebSocketUtils.sendMessageSingle(dto); WebSocketUtils.sendMessageSingle(dto);
} }
} catch (Exception e) { } 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) @KafkaListener(id = MESSAGE_CONSUME_ID, topics = KafkaTopicConstants.API_REPORT_TASK_TOPIC, groupId = MESSAGE_CONSUME_ID)
public void messageConsume(ConsumerRecord<?, String> record) { public void messageConsume(ConsumerRecord<?, String> record) {
try { try {
LogUtils.info("接收到发送通知信息:", record.key()); LogUtils.info("接收到发送通知信息:{}", record.key());
if (ObjectUtils.isNotEmpty(record.value())) { if (ObjectUtils.isNotEmpty(record.value())) {
ApiNoticeDTO dto = JSON.parseObject(record.value(), ApiNoticeDTO.class); ApiNoticeDTO dto = JSON.parseObject(record.value(), ApiNoticeDTO.class);
@ -40,7 +40,7 @@ public class MessageListener {
if (!StringUtils.equalsIgnoreCase(dto.getReportType(), ApiReportType.INTEGRATED.name())) { if (!StringUtils.equalsIgnoreCase(dto.getReportType(), ApiReportType.INTEGRATED.name())) {
apiReportSendNoticeService.sendNotice(dto); apiReportSendNoticeService.sendNotice(dto);
// TODO 通知测试计划处理后续 // TODO 通知测试计划处理后续
LogUtils.info("发送通知给测试计划:", record.key()); LogUtils.info("发送通知给测试计划:{}", record.key());
apiEventSource.fireEvent(ApplicationScope.API_TEST, record.value()); apiEventSource.fireEvent(ApplicationScope.API_TEST, record.value());
} }
@ -50,7 +50,7 @@ public class MessageListener {
} }
} catch (Exception e) { } 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)); .forEach(item -> JmeterElementConverterRegister.register((Class<? extends AbstractJmeterElementConverter<? extends MsTestElement>>) item));
} }
} catch (Exception e) { } catch (Exception e) {
LogUtils.error("注册接口插件实现类失败:", e); LogUtils.error("注册接口插件实现类失败:{}", e);
} }
} }
} }

View File

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