@@ -26,20 +26,26 @@ public SearchLogger(TextWriter writer, Action<string>? progressCallback = null)
2626 _progressCallback = progressCallback ;
2727 }
2828
29- public void LogHeader ( string operation , string workingDirectory , string targetFile )
29+ public void LogHeader ( string operation , string workingDirectory , string targetFile , string ? tempDirectory = null )
3030 {
3131 var divider = new string ( '=' , 50 ) ;
3232 _writer . WriteLine ( divider ) ;
3333 _writer . WriteLine ( $ "GitContentSearch { operation } started at { DateTime . Now : yyyy-MM-dd HH:mm:ss} ") ;
3434 _writer . WriteLine ( $ "Working Directory (Git Repo): { workingDirectory } ") ;
3535 _writer . WriteLine ( $ "File to { operation . ToLower ( ) } : { targetFile } ") ;
36+
37+ // Use the provided temp directory or default to the standard path
38+ string tempDir = tempDirectory ?? Path . Combine ( Path . GetTempPath ( ) , "GitContentSearch" ) ;
39+ _writer . WriteLine ( $ "Logs and temporary files will be created in: { tempDir } ") ;
40+
3641 _writer . WriteLine ( divider ) ;
3742
3843 // Trigger LogAdded event for each line
3944 LogAdded ? . Invoke ( this , divider ) ;
4045 LogAdded ? . Invoke ( this , $ "GitContentSearch { operation } started at { DateTime . Now : yyyy-MM-dd HH:mm:ss} ") ;
4146 LogAdded ? . Invoke ( this , $ "Working Directory (Git Repo): { workingDirectory } ") ;
4247 LogAdded ? . Invoke ( this , $ "File to { operation . ToLower ( ) } : { targetFile } ") ;
48+ LogAdded ? . Invoke ( this , $ "Logs and temporary files will be created in: { tempDir } ") ;
4349 LogAdded ? . Invoke ( this , divider ) ;
4450 }
4551
0 commit comments