Skip to content

feat: log cache retrieval attempts in _get_transcripts method - #69

Closed
kaya70875 wants to merge 2 commits into
mainfrom
feat/information-cache
Closed

feat: log cache retrieval attempts in _get_transcripts method#69
kaya70875 wants to merge 2 commits into
mainfrom
feat/information-cache

Conversation

@kaya70875

Copy link
Copy Markdown
Owner

No description provided.

@kaya70875 kaya70875 self-assigned this Jun 23, 2026
@kaya70875 kaya70875 added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 23, 2026
@what-the-diff

what-the-diff Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR Summary

  • Enhancement of Troubleshooting Capability
    Added a feature into the system which will record information whenever the system tries to access stored conversation scripts. This improvement can assist in detecting and resolving any potential issues more efficiently.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Log cache retrieval attempt in transcript fetching path
✨ Enhancement 🕐 Less than 5 minutes

Grey Divider

Description

• Log when transcript retrieval attempts will use the configured cache.
• Improve observability of the cache vs network fetching decision in _get_transcripts().
Diagram

graph TD
  A["_get_transcripts()"] --> B{Cache enabled?} -->|"yes"| C["logger.info(...)"] --> D["_get_or_fetch_transcripts()"]
  B -->|"no"| E["_fetch_with_recovery_pass()"]
Loading
High-Level Assessment

The approach is appropriate for lightweight observability. The main consideration is log volume (this runs per _get_transcripts() call), but an info log is reasonable if this method isn’t called in tight loops; otherwise consider debug in a follow-up.

Files changed (1) +1 / -0

Enhancement (1) +1 / -0
_core.pyAdd info log before attempting transcript retrieval via cache +1/-0

Add info log before attempting transcript retrieval via cache

• Emits an 'info' log when '_get_transcripts()' detects a configured cache and will use the cache-backed retrieval path. This improves runtime visibility into whether transcripts are being retrieved via cache or fetched.

ytfetcher/_core.py

@qodo-code-review

qodo-code-review Bot commented Jun 23, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Noisy cache info log ✓ Resolved 🐞 Bug ◔ Observability
Description
_get_transcripts() now emits an INFO log on every cached transcript lookup, which will appear in the
CLI default (non-verbose) mode and can clutter normal output. This is inconsistent with other cache
diagnostics (lookup/miss) that are DEBUG-only, reducing signal-to-noise in logs.
Code

ytfetcher/_core.py[254]

+            logger.info("Attempting to retrieve transcripts from cache...")
Relevance

⭐⭐⭐ High

Team previously reduced noisy INFO logs (exports moved to DEBUG) and aimed for quieter default
output.

PR-#58
PR-#24

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new INFO line executes whenever self._cache is enabled; the CLI config sets INFO level by
default (non-verbose), so this message will show up in normal CLI runs. Existing cache diagnostics
(cache miss / lookup) are logged at DEBUG, indicating cache internals are intended to be hidden
unless verbose/debug logging is enabled.

ytfetcher/_core.py[251-256]
ytfetcher/_core.py[276-309]
ytfetcher/config/logging_config.py[18-37]
ytfetcher/_cli.py[315-323]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`YTFetcher._get_transcripts()` logs `Attempting to retrieve transcripts from cache...` at INFO whenever caching is enabled. Since the CLI configures logging at INFO by default, this message becomes user-visible in normal runs and adds noise compared to existing cache-related logs that are DEBUG.

## Issue Context
- Cache lookup/miss diagnostics already exist at DEBUG.
- CLI default logging level is INFO when `--verbose` is not passed.

## Fix Focus Areas
- ytfetcher/_core.py[251-256]
- ytfetcher/config/logging_config.py[18-37]

## Suggested fix
- Change this new log line to `logger.debug(...)`, and optionally include helpful context such as `len(video_ids)` (and/or cache_key if readily available) to make the debug message actionable.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@kaya70875 kaya70875 closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant