fix: centralize logging configuration in run.py to ensure consistent timestamps

This commit is contained in:
ChuckBuilds
2025-04-19 18:04:52 -05:00
parent b221ab8d2a
commit 686f5cdee6
2 changed files with 18 additions and 7 deletions

17
run.py Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
import logging
import sys
# Configure logging before importing any other modules
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s.%(msecs)03d - %(levelname)s:%(name)s:%(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
stream=sys.stdout # Explicitly set to stdout
)
# Now import the display controller
from src.display_controller import main
if __name__ == "__main__":
main()

View File

@@ -10,13 +10,7 @@ from src.stock_news_manager import StockNewsManager
from src.nhl_managers import NHLLiveManager, NHLRecentManager, NHLUpcomingManager from src.nhl_managers import NHLLiveManager, NHLRecentManager, NHLUpcomingManager
from src.nba_managers import NBALiveManager, NBARecentManager, NBAUpcomingManager from src.nba_managers import NBALiveManager, NBARecentManager, NBAUpcomingManager
# Configure logging # Get logger without configuring
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s.%(msecs)03d - %(levelname)s:%(name)s:%(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class DisplayController: class DisplayController: