Replace print with uniform logging across Ankimon#271
Replace print with uniform logging across Ankimon#271google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
- Replaced `print()` calls with `mw.logger.log()` or injected `logger.log()` across `src/Ankimon/`. - Updated `Settings` and `DataHandler` classes to accept `logger` via dependency injection. - Updated `singletons.py` to inject `logger` into `Settings` and `DataHandler`. - Updated `PokemonCollectionDialog` to handle logging correctly in `trade_pokemon` helper functions using `mw.logger`. - Refactored `src/Ankimon/utils.py`, `src/Ankimon/functions/`, and `src/Ankimon/poke_engine/` files to use logging. - Configured standard python logging for standalone script `update_moves.py`. - Removed commented-out debug print statements in `pokedex_obj.py`. - Replaced `showInfo` calls in `TrainerCard` with `logger.log_and_showinfo` for consistency.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR replaces inconsistent
printstatements with the standardized Ankimon logger (ShowInfoLoggerinstance).Key changes:
SettingsandDataHandlernow accept aloggerinstance in their constructor.singletons.pyhas been updated to pass the global logger instance.printwithlogger.log(levels: info, warning, error) throughout the codebase, includingutils.py,trainer_card.py, and various function modules.showInfopopups withlogger.log_and_showinfo(mostly for errors) to ensure they are logged.update_moves.pynow uses the standardloggingmodule as it runs independently of Anki.This ensures all logs are captured uniformly and respects the user's request to eliminate raw print statements.
PR created automatically by Jules for task 3938066199095898363 started by @h0tp-ftw