From ef846e549971c8f47119348d0e9097dda7b9bdc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 2 Sep 2024 19:10:31 +0800 Subject: [PATCH] feat: +log --- metagpt/tools/libs/index_repo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metagpt/tools/libs/index_repo.py b/metagpt/tools/libs/index_repo.py index 105a11d73..c4d3ea61a 100644 --- a/metagpt/tools/libs/index_repo.py +++ b/metagpt/tools/libs/index_repo.py @@ -98,8 +98,10 @@ class IndexRepo(BaseModel): token_count = len(encoding.encode(content)) if self._is_buildable(token_count): filter_filenames.append(i) + logger.debug(f"{i} is_buildable") else: delete_filenames.append(i) + logger.debug(f"{i} not is_buildable") await self._add_batch(filenames=filter_filenames, delete_filenames=delete_filenames) async def _add_batch(self, filenames: List[Union[str, Path]], delete_filenames: List[Union[str, Path]]): @@ -149,6 +151,7 @@ class IndexRepo(BaseModel): path = Path(i).absolute() if not path.is_relative_to(root_path): excludes.append(path) + logger.debug(f"{path} not is_relative_to {root_path})") continue if not path.is_dir(): is_text, _ = await is_text_file(path) @@ -161,6 +164,7 @@ class IndexRepo(BaseModel): if is_text: pathnames.append(j) + logger.debug(f"{pathnames}, excludes:{excludes})") return pathnames, excludes async def _search(self, query: str, filters: Set[str]) -> List[NodeWithScore]: