Skip to content

Commit 49b2f9f

Browse files
committed
[#noissue] Cleanup
1 parent 267a81e commit 49b2f9f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

‎exceptiontrace/exceptiontrace-collector/src/main/java/com/navercorp/pinpoint/exceptiontrace/collector/dao/PinotExceptionTraceDao.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
@Repository
4141
public class PinotExceptionTraceDao implements ExceptionTraceDao {
4242
private final Logger logger = LogManager.getLogger(this.getClass());
43+
private final boolean isDebugEnabled = logger.isDebugEnabled();
4344

4445
private final KafkaTemplate<String, ExceptionMetaDataEntity> kafkaExceptionMetaDataTemplate;
4546

@@ -64,11 +65,16 @@ public PinotExceptionTraceDao(
6465
@Override
6566
public void insert(List<ExceptionMetaData> exceptionMetaData) {
6667
Objects.requireNonNull(exceptionMetaData);
67-
logger.info("Pinot data insert: {}", exceptionMetaData);
68+
69+
if (isDebugEnabled) {
70+
logger.debug("Pinot data insert: {}", exceptionMetaData);
71+
}
6872

6973
for (ExceptionMetaData e : exceptionMetaData) {
7074
ExceptionMetaDataEntity dataEntity = mapper.toEntity(e);
71-
logger.info("data insert {}", dataEntity);
75+
if (isDebugEnabled) {
76+
logger.debug("data insert {}", dataEntity);
77+
}
7278
CompletableFuture<SendResult<String, ExceptionMetaDataEntity>> response = this.kafkaExceptionMetaDataTemplate.send(
7379
topic, dataEntity
7480
);

‎exceptiontrace/exceptiontrace-web/src/test/java/com/navercorp/pinpoint/exceptiontrace/web/model/ExceptionTraceValueViewTest.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@ void testGetFieldName() {
1616
GroupedFieldName emptyFieldName = new GroupedFieldName();
1717
emptyFieldName.setErrorMessage("");
1818
view.setGroupedFieldName(emptyFieldName);
19-
2019
assertEquals(ExceptionTraceValueView.EMPTY_STRING, view.getFieldName());
2120

21+
2222
GroupedFieldName nullStringFieldName = new GroupedFieldName();
23-
emptyFieldName.setErrorMessage("null");
24-
view.setGroupedFieldName(emptyFieldName);
23+
nullStringFieldName.setErrorMessage("null");
24+
view.setGroupedFieldName(nullStringFieldName);
25+
assertEquals("null", view.getFieldName());
2526

26-
assertEquals(ExceptionTraceValueView.EMPTY_STRING, view.getFieldName());
2727

2828
GroupedFieldName nullFieldName = new GroupedFieldName();
2929
view.setGroupedFieldName(nullFieldName);
30-
3130
assertEquals(ExceptionTraceValueView.TOTAL_FIELDNAME, view.getFieldName());
3231

3332

3433
view.setGroupedFieldName(null);
35-
3634
assertEquals(ExceptionTraceValueView.TOTAL_FIELDNAME, view.getFieldName());
3735
}
3836
}

0 commit comments

Comments
 (0)