From 84e68c6f24db3c12dc8a5af90cd3b346d01d02a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Mon, 30 Oct 2023 17:04:25 +0100 Subject: [PATCH] fix: made verbose tabcomplete init prints into debug logs --- gptme/tabcomplete.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gptme/tabcomplete.py b/gptme/tabcomplete.py index e8dcf43f..40208f10 100644 --- a/gptme/tabcomplete.py +++ b/gptme/tabcomplete.py @@ -1,25 +1,28 @@ +import logging import readline from functools import lru_cache from pathlib import Path from .commands import CMDFIX, COMMANDS +logger = logging.getLogger(__name__) + def register_tabcomplete() -> None: """Register tab completion for readline.""" # set up tab completion - print("Setting up tab completion") + logger.debug("Setting up tab completion") readline.set_completer(_completer) readline.set_completer_delims(" ") readline.parse_and_bind("tab: complete") # https://github.com/python/cpython/issues/102130#issuecomment-1439242363 if "libedit" in readline.__doc__: # type: ignore - print("Found libedit readline") + logger.debug("Found libedit readline") readline.parse_and_bind("bind ^I rl_complete") else: - print("Found gnu readline") + logger.debug("Found gnu readline") readline.parse_and_bind("tab: complete")