Skip to content

Commit

Permalink
chore: make showin logs in chat optional
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Dec 16, 2024
1 parent 908479b commit 96975ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/llmling_agent/cli/chat_session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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()
Expand Down

0 comments on commit 96975ff

Please sign in to comment.