File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 44from typing import Any , Optional
55
66from git import Repo , InvalidGitRepositoryError
7+ from patchwork .logger import logger
78from openai .types .chat import ChatCompletionMessageParam
89
910from patchwork .common .client .llm .aio import AioLlmClient
@@ -177,10 +178,10 @@ def run(self):
177178 modified_file ["diff" ] = diff
178179 except Exception as e :
179180 # Git-specific errors (untracked files, etc) - keep empty diff
180- print (f"Note: Could not get git diff for { file } : { str (e )} " )
181+ logger . warning (f"Could not get git diff for { file } : { str (e )} " )
181182 except Exception as e :
182183 # General file processing errors
183- print (f"Warning: Failed to process file { file } : { str (e )} " )
184+ logger . warning (f"Failed to process file { file } : { str (e )} " )
184185
185186 modified_files_with_diffs .append (modified_file )
186187
Original file line number Diff line number Diff line change 33import difflib
44from pathlib import Path
55
6+ from patchwork .logger import logger
67from patchwork .step import Step , StepStatus
78
89
@@ -128,7 +129,7 @@ def run(self) -> dict:
128129 if not diff and new_code : # If no diff but we have new code (new file)
129130 diff = f"+++ { file_path } \n { new_code } "
130131 except (OSError , IOError ) as e :
131- print (f"Warning: Failed to generate diff for { file_path } : { str (e )} " )
132+ logger . warning (f"Failed to generate diff for { file_path } : { str (e )} " )
132133 # Still proceed with the modification even if diff generation fails
133134 replace_code_in_file (file_path , start_line , end_line , new_code )
134135 diff = f"+++ { file_path } \n { new_code } " # Use new code as diff on error
You can’t perform that action at this time.
0 commit comments