Skip to content

Commit a602fc4

Browse files
authored
Merge pull request #7 from alalkamys/feat/set-files-search-logs-to-debug-log-level
Feat: Imrpoved Logging
2 parents e22bd78 + 7c7feba commit a602fc4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

app/helpers/operations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,23 @@ def search_and_replace(directory: str, patterns: dict, excluded_files: list[str]
169169
for file in files:
170170
file_path = os.path.join(root, file)
171171
file_relpath = os.path.relpath(file_path, directory)
172-
_logger.info(
172+
_logger.debug(
173173
f"Searching '{file_relpath}'")
174174
try:
175175
with open(file_path, 'rb') as f:
176176
content = f.read().decode('utf-8', "ignore")
177177
except Exception as e:
178178
_logger.error(f"Error reading file '{
179179
file_relpath}': {str(e)}")
180-
_logger.info("Skipping..")
180+
_logger.debug("Skipping..")
181181
continue
182182
updated_content = content
183183
for pattern, replacement in patterns.items():
184184
try:
185185
matches = re.findall(pattern, content)
186186
if matches:
187187
_logger.info(
188-
f"A match was found for pattern '{pattern}'")
188+
f"A match was found for pattern '{pattern}' in '{file_relpath}'")
189189
result[pattern]['match'][file_relpath] = len(
190190
matches)
191191
result[pattern]['count'] += len(matches)

main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
if len(TARGET_REPOS) > 0 and len(REPLACEMENTS) > 0:
4545
_logger.info(f"Loaded '{len(TARGET_REPOS)}' repositories out of '{
4646
len(TARGETS_CONFIG['targetRepos'])}' provided repositories")
47-
_logger.info(f"'{len(TARGET_REPOS)}' target repo(s) found")
4847
_logger.info("Initiating code migration assistant program..")
4948
_logger.info(f"Mode: {MODE}")
5049
final_result = {}

0 commit comments

Comments
 (0)