From 30cb68c003bb62bc4c8a23c37a77dcfd115877ad Mon Sep 17 00:00:00 2001 From: sb Date: Sun, 5 Jul 2026 12:12:04 +0900 Subject: [PATCH] =?UTF-8?q?chore(ai):=20=EC=8B=9C=EC=9E=91=20=EC=8B=9C=20A?= =?UTF-8?q?I=20=ED=8C=8C=EC=84=9C=20=ED=99=9C=EC=84=B1/=ED=82=A4=EB=A1=9C?= =?UTF-8?q?=EB=94=A9=20=EC=A7=84=EB=8B=A8=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .../com/sb/web/account/service/AiEntryParser.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/sb/web/account/service/AiEntryParser.java b/src/main/java/com/sb/web/account/service/AiEntryParser.java index f9f4d68..495c237 100644 --- a/src/main/java/com/sb/web/account/service/AiEntryParser.java +++ b/src/main/java/com/sb/web/account/service/AiEntryParser.java @@ -38,6 +38,17 @@ public class AiEntryParser { return apiKey != null && !apiKey.isBlank(); } + /** 시작 시 AI 파서 활성 여부·키 로딩 상태를 로그로 남겨 진단을 쉽게 한다(키는 앞부분만 마스킹). */ + @jakarta.annotation.PostConstruct + void logConfig() { + if (enabled()) { + String masked = apiKey.length() > 14 ? apiKey.substring(0, 14) + "…(len=" + apiKey.length() + ")" : "(len=" + apiKey.length() + ")"; + log.info("[ai-parse] 활성화됨 — model={}, key={}", model, masked); + } else { + log.warn("[ai-parse] 비활성(ANTHROPIC_API_KEY 미설정) — 규칙기반 파서만 사용"); + } + } + /** 자유 텍스트 → 파싱 결과. 실패/미설정 시 empty. */ public Optional parse(String text, LocalDate today) { if (!enabled() || text == null || text.isBlank()) return Optional.empty();