diff --git a/ai_diplomacy/clients.py b/ai_diplomacy/clients.py index ca1c15b..61b5819 100644 --- a/ai_diplomacy/clients.py +++ b/ai_diplomacy/clients.py @@ -454,6 +454,8 @@ class BaseModelClient: else: # Load generic conversation instructions instructions = load_prompt(get_prompt_path("conversation_instructions.txt"), prompts_dir=self.prompts_dir) + + logger.debug(f"[{power_name}] Conversation instructions: {instructions}") # KEEP ORIGINAL: Use build_context_prompt as before context = build_context_prompt( @@ -468,6 +470,8 @@ class BaseModelClient: prompts_dir=self.prompts_dir, ) + logger.debug(f"[{power_name}] Conversation context: {context}") + # KEEP ORIGINAL: Get recent messages targeting this power to prioritize responses recent_messages_to_power = game_history.get_recent_messages_to_power(power_name, limit=3) diff --git a/ai_diplomacy/game_history.py b/ai_diplomacy/game_history.py index 0e0ce2f..5652fed 100644 --- a/ai_diplomacy/game_history.py +++ b/ai_diplomacy/game_history.py @@ -6,8 +6,8 @@ from typing import Dict, List, Optional import re logger = logging.getLogger("utils") -logger.setLevel(logging.INFO) -logging.basicConfig(level=logging.INFO) +# Level inherited from root (set in lm_game.py); use --debug for DEBUG globally. + load_dotenv() diff --git a/ai_diplomacy/negotiations.py b/ai_diplomacy/negotiations.py index b21696f..6ce8135 100644 --- a/ai_diplomacy/negotiations.py +++ b/ai_diplomacy/negotiations.py @@ -13,8 +13,7 @@ if TYPE_CHECKING: from diplomacy import Game logger = logging.getLogger("negotiations") -logger.setLevel(logging.INFO) -logging.basicConfig(level=logging.INFO) +# Level inherited from root (set in lm_game.py); use --debug for DEBUG globally. load_dotenv() diff --git a/ai_diplomacy/utils.py b/ai_diplomacy/utils.py index e1ab2e9..66a3073 100644 --- a/ai_diplomacy/utils.py +++ b/ai_diplomacy/utils.py @@ -24,8 +24,7 @@ if TYPE_CHECKING: # from .agent import DiplomacyAgent logger = logging.getLogger("utils") -logger.setLevel(logging.INFO) -logging.basicConfig(level=logging.INFO) +# Level inherited from root (set in lm_game.py); use --debug for DEBUG globally. load_dotenv() diff --git a/lm_game.py b/lm_game.py index 8961b06..b0ad1f2 100644 --- a/lm_game.py +++ b/lm_game.py @@ -205,8 +205,7 @@ async def main(): config.DEBUG = getattr(args, "debug", False) if config.DEBUG: logging.getLogger().setLevel(logging.DEBUG) - # debug_log_llm_io() in ai_diplomacy.utils uses logger.debug(); ensure that logger is not capped at INFO - logging.getLogger("utils").setLevel(logging.DEBUG) + # Named loggers (negotiations, utils, etc.) inherit root when they don't set their own level. logger.info("Debug mode enabled: logger.debug() messages and every LLM input/output will be shown.") logger.info(f"args.simple_prompts = {args.simple_prompts} (type: {type(args.simple_prompts)}), args.prompts_dir = {args.prompts_dir}")