Skip to content

Commit b09a414

Browse files
manavgupclaude
andcommitted
fix: Change verbose logging from info to debug in answer_synthesizer
Production logs were being flooded with verbose debug output including emojis and 300-char answer previews. Changed all diagnostic logging from logger.info to logger.debug to prevent log pollution in production. Affected lines: 50-55, 60, 72 (answer_synthesizer.py) Addresses Critical Issue #3 from PR review comment #3447949328 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7bc8112 commit b09a414

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

backend/rag_solution/services/answer_synthesizer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ def synthesize(self, original_question: str, reasoning_steps: list[ReasoningStep
4747
return "Unable to synthesize an answer from the reasoning steps."
4848

4949
# DEBUG: Log what we receive from CoT
50-
logger.info("=" * 80)
51-
logger.info("📝 ANSWER SYNTHESIZER DEBUG")
52-
logger.info("Number of intermediate answers: %d", len(intermediate_answers))
50+
logger.debug("=" * 80)
51+
logger.debug("📝 ANSWER SYNTHESIZER DEBUG")
52+
logger.debug("Number of intermediate answers: %d", len(intermediate_answers))
5353
for i, answer in enumerate(intermediate_answers):
54-
logger.info("Intermediate answer %d (first 300 chars): %s", i + 1, answer[:300])
55-
logger.info("=" * 80)
54+
logger.debug("Intermediate answer %d (first 300 chars): %s", i + 1, answer[:300])
55+
logger.debug("=" * 80)
5656

5757
# For single answer, return it directly (already clean from XML parsing)
5858
if len(intermediate_answers) == 1:
5959
final = intermediate_answers[0]
60-
logger.info("🎯 FINAL ANSWER (single step, first 300 chars): %s", final[:300])
60+
logger.debug("🎯 FINAL ANSWER (single step, first 300 chars): %s", final[:300])
6161
return final
6262

6363
# For multiple answers, combine cleanly without contaminating prefixes
@@ -69,7 +69,7 @@ def synthesize(self, original_question: str, reasoning_steps: list[ReasoningStep
6969
if answer.lower() not in synthesis.lower():
7070
synthesis += f" {answer}"
7171

72-
logger.info("🎯 FINAL SYNTHESIZED ANSWER (first 300 chars): %s", synthesis[:300])
72+
logger.debug("🎯 FINAL SYNTHESIZED ANSWER (first 300 chars): %s", synthesis[:300])
7373
return synthesis
7474

7575
async def synthesize_answer(self, original_question: str, reasoning_steps: list[ReasoningStep]) -> SynthesisResult:

0 commit comments

Comments
 (0)