Skip to content

Commit

Permalink
refactor: change log format
Browse files Browse the repository at this point in the history
- 로그 포맷 변경
  • Loading branch information
seokwns committed Jan 22, 2024
1 parent 752fd31 commit daf0ccb
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public CompletableFuture<AnalyzeResponse> analyze(NaverSearchResponse searchResp
.stream()
.map(request -> CompletableFuture.runAsync(() -> analyze(result, imageMap, imageParseRequests, request)))
.toList();
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new)).join();

log.debug("HTML 파싱 완료. Vision API 요청 작업 시작");
log.debug("포스트 분석 완료. Vision API 요청 작업 시작");
List<String> visionResponse = googleVisionAPI.call(imageParseRequests);

log.debug("Vision API 작업 완료. 파싱 결과 병합 시작");
Expand Down Expand Up @@ -163,7 +163,11 @@ private void mergeVisionAPIResults(Map<String, Boolean> result, List<ImageParseR
imageParseRequests.forEach(request -> {
String text = visionResponseQueue.poll();
boolean advertisement = textAnalyzer.analyzeImageText(text);
log.debug(request.imageLink() + " | " + text + " | " + advertisement);
log.debug("Vision API 응답 결과\n" +
"Post Link: " + request.postLink() + "\n" +
"Image Link: " + request.imageLink() + "\n" +
"Text: " + text + "\n" +
"advertisement: " + advertisement);

result.put(request.postLink(), advertisement);

Expand Down

0 comments on commit daf0ccb

Please sign in to comment.