[Refactor] Centralized configs, standardizes logging with loguru and add type safety#271
Open
JoseCostaUni wants to merge 17 commits into
Open
[Refactor] Centralized configs, standardizes logging with loguru and add type safety#271JoseCostaUni wants to merge 17 commits into
JoseCostaUni wants to merge 17 commits into
Conversation
- Add centralized logging configuration in src/lib/logging.py - Replace 50+ print statements with appropriate logger levels - Support --debug flag for verbose output - Add logger imports to all affected modules: * main.py * src/f1_data.py * src/interfaces/qualifying.py * src/services/stream.py * src/ui_components.py * src/run_session.py * src/gui/pit_wall_window.py * src/gui/insights_menu.py * src/insights/telemetry_stream_viewer.py Fixes IAmTomShaw#39, enables better debugging of IAmTomShaw#245 and IAmTomShaw#127 Improves visibility of errors and processing steps
…ntime popup_width, popup_height, popup_header_font_size, popup_body_font_size, and map_padding_ratio_default were referenced in race_replay.py but were never added to UIConfig after the magic-number removal commit (0889ab9).
…alues - Updated safety_car_glow_alpha default from 128 to 80 in UIConfig - Replaced hardcoded regular_car_radius (6) with UIConfig.regular_car_radius - Replaced hardcoded safety_car_glow_alpha (80) with UIConfig.safety_car_glow_alpha - Replaced hardcoded safety_car_radius (8) with UIConfig.safety_car_radius Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
src/config.py— a single source of truth for all configuration usingpydantic-settings. All magic numbers (screen size, FPS, network ports, playback speeds, UI margins, etc.) are now named, documented, and overridable via environment variables or.env.{timestamp} | {level} | {module} | {message}format.src/lib/exceptions.pywith a structured exception hierarchy (F1DataError,StreamError,SessionNotAvailableError, etc.) replacing bareraise Exception(...)calls.stream.py,qualifying.py,f1_data.py, and others.Closes issue #270