diff --git a/src/llmling_agent/cli/chat_session/session.py b/src/llmling_agent/cli/chat_session/session.py index bc3797ca..ff3a4b7b 100644 --- a/src/llmling_agent/cli/chat_session/session.py +++ b/src/llmling_agent/cli/chat_session/session.py @@ -56,6 +56,7 @@ def __init__( agent: LLMlingAgent[str], *, log_level: int = logging.INFO, + show_log_in_chat: bool = False, stream: bool = False, ) -> None: """Initialize interactive session.""" @@ -71,10 +72,11 @@ def __init__( self.status_bar = StatusBar(self.console) # Setup logging - self._log_handler = SessionLogHandler(self._output_writer) - self._log_handler.setLevel(log_level) - logging.getLogger("llmling_agent").addHandler(self._log_handler) - logging.getLogger("llmling").addHandler(self._log_handler) + if show_log_in_chat: + self._log_handler = SessionLogHandler(self._output_writer) + self._log_handler.setLevel(log_level) + logging.getLogger("llmling_agent").addHandler(self._log_handler) + logging.getLogger("llmling").addHandler(self._log_handler) # Setup components self._setup_history()