Added some more logging to the INFO level

This commit is contained in:
Harrison Deng 2023-04-26 13:47:09 -05:00
parent c6d79c9eb1
commit b745915e49

View File

@ -6,6 +6,12 @@ from typing import Iterable
def find_all_candidates(input_dir: str, regex: str, recursive: bool):
logging.info(
'Searching "%s" for files that match "%s" %s',
input_dir,
regex,
"recursively" if recursive else "non-recursively",
)
results = []
for subitem in os.listdir(input_dir):
subitem_path = os.path.join(input_dir, subitem)
@ -19,6 +25,13 @@ def find_all_candidates(input_dir: str, regex: str, recursive: bool):
continue
results.append((subitem_path, subitem, match))
logging.debug(f'Collecting "{subitem}"...')
if len(results) < 1:
logging.info(
'No results found matching "%s" in "%s". Please double check your REGEX '
"pattern and directory being searched.",
regex,
input_dir,
)
return results