refactor: remove noisy debug logs from flash (AE-1966)#204
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes noisy debug logs that were cluttering development output, reducing debug line count from 200+ to <20 during normal operations. The changes follow a consistent pattern: remove per-item logs while preserving summary logs, errors, and warnings.
Changes:
- Removed 29+ debug log statements across 6 files that fired repeatedly during normal operations (per-resource, per-class, per-request)
- Commented out (rather than deleted) multi-KB API request/response dumps in runpod.py to preserve for future debugging
- Maintained all error/warning logs and summary-level informational logs
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/runpod_flash/runtime/load_balancer.py | Removed 3 per-request selection debug logs that fired 100+ times per second |
| src/runpod_flash/execute_class.py | Removed 5 per-class serialization debug logs that fired 5-10× per run |
| src/runpod_flash/core/discovery.py | Removed 2 per-resource discovery debug logs that fired 10-20× per run |
| src/runpod_flash/core/api/runpod.py | Commented out 8 debug logs dumping multi-KB API requests/responses, added noqa comment for json import |
| src/runpod_flash/client.py | Removed 5 decorator execution debug logs and unused flash_resource_name variable |
| src/runpod_flash/cli/commands/build_utils/scanner.py | Changed 6 debug logs to silent exception handling (pass) following codebase pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Remove debug logs from client.py that fire on every @Remote function/class: - RUNPOD_ENDPOINT_ID/FLASH_RESOURCE_NAME environment check logs - Local dev mode stub creation logs - is_local_function result logs - Original function return logs - Remote execution wrapper creation logs Also remove unused flash_resource_name variable that was only used in the removed debug log. These logs provide no actionable information during normal development and create substantial noise (5-10 lines per decorated item).
Remove 5 debug log lines that fire for every @Remote class: - Cached class data log (line 60) - Retrieved cached class data log (lines 84-86) - Successfully extracted class code log (line 125) - Generated cache key log (line 185) - Created remote class wrapper log (line 232) These logs fire 5-10 times per run and only matter when debugging class serialization issues, not during normal development.
Remove 2 debug log lines that fire for every decorated resource: - Entry point resource discovery log (lines 55-57) - Project directory resource discovery log (lines 408-410) These logs fire 10-20 times per run. The INFO-level summary logs already show total resource counts, making per-resource debug logs redundant.
Remove 6 duplicate debug log lines across three scanning passes: - First pass (resource configs): lines 77, 81 - Second pass (@Remote functions): lines 90, 94 - Third pass (function calls): lines 118, 122 These logs fire 3× per Python file during scanning (150+ logs for 50 files). Parse failures in dependencies are expected and not actionable. Keep SyntaxError warnings as they indicate actual issues.
Remove 3 debug log lines that fire on every request: - ROUND_ROBIN selection log (lines 88-91) - LEAST_CONNECTIONS selection log (lines 112-115) - RANDOM selection log (line 128) These logs fire on EVERY request (100+ times per second in production) and would flood production systems with no actionable value.
Comment out (not remove) 8 debug log lines in API methods: GraphQL (_execute_graphql): - GraphQL Query log - GraphQL Variables log - GraphQL Response Status log - GraphQL Response log REST (_execute_rest): - REST Request log - REST Data log - REST Response Status log - REST Response log These logs dump multi-KB JSON responses on every API call (10-50× per deploy operation). Commenting out preserves them for future debugging while silencing them during normal development. Add noqa comment to json import since it's only used in commented code.
Removed 6 noisy logs that fire per-resource operation: - get_or_deploy_resource called with config dump - DRIFT DEBUG with existing/new config fields - Resource found in cache (per-lookup) - exists, reusing (per-reuse) - Resource NOT found in cache (per-deployment) - Config drift detected (redundant with warning log)
…cation Removed %(name)s | %(filename)s:%(lineno)d from DEBUG format. DEBUG and INFO now use the same clean format: timestamp | level | message Updated test to match new behavior.
Removed 3 noisy logs: - Version-triggering changes detected (INFO) - Structural change in field (DEBUG, 2 occurrences) These logs fire during endpoint updates and provide no actionable value.
Set httpcore and httpx loggers to WARNING level to suppress verbose connection/request trace logs that appear in DEBUG mode: - connect_tcp.started/complete - start_tls.started/complete - send_request_headers/body - receive_response_headers These low-level HTTP transport logs provide no actionable value during normal development.
Replaced overly broad TOKEN_PATTERN with PREFIXED_KEY_PATTERN that only redacts tokens with known sensitive prefixes (sk-, key_, api_). This fixes false positives where Job IDs, Worker IDs, and Template IDs were being redacted even though they're not sensitive. Updated test to use prefixed token instead of generic long token.
a70183e to
18b4350
Compare
Removed repetitive and overly-verbose debug logs: - ignore.py: Remove per-file "Ignoring:" logs (pattern summary sufficient) - app.py: Remove "already hydrated" debug log - runpod.py: Remove logs that print full input_data/variables (finalizing upload, fetching environment, deploying environment) - runpod.py: Change template update logs from info to debug - serverless.py: Change template update log from info to debug These logs added noise without value. Pattern summaries and operation names provide sufficient context.
Removed verbose file locking and resource persistence logs: - file_lock.py: Remove "File lock acquired" and "File lock released" - resource_manager.py: Remove "Saved resources in .runpod/resources.pkl" - logger.py: Silence asyncio logger (prevents "Using selector: KqueueSelector") These operational details added noise without debugging value.
Removed: - runpod.py: "Fetching flash app by name for input:" - app.py: "Hydrating app" These operation-level logs add noise without debugging value.
jhcipar
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive cleanup of noisy debug logs and logging improvements across the flash library. Removed 59+ debug/info log statements that generated excessive output during development (200+ lines at startup), simplified DEBUG format, silenced HTTP transport logs, and fixed false redaction of Job/Template IDs.
Changes
Debug Log Removal (41 logs)
API Logs (8 commented out, not removed)
runpod.py: Multi-KB GraphQL/REST request/response dumps preserved but commented for future debuggingLogging System Improvements
1. DEBUG Format Simplification
%(name)s | %(filename)s:%(lineno)dfrom DEBUG format2026-02-13 22:27:04,553 | DEBUG | runpod_flash.core.utils.file_lock | file_lock.py:105 | Message2026-02-13 22:27:04,553 | DEBUG | Message2. HTTP/Async Transport Log Silencing
connect_tcp.started,send_request_headers, etc.3. Sensitive Data Filter Fix
TOKEN_PATTERNwithPREFIXED_KEY_PATTERN4. Template Update Logs
Verification
Design Decisions