Skip to content

Commit 96d5a1a

Browse files
committed
chore(doc_loader): add logging for included documents
Adds eprintln! statements to log the relative path of each document (Markdown, Rust source, extracted HTML) as it is added to the list for embedding. This helps in debugging which files are being processed.
1 parent 6830774 commit 96d5a1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/doc_loader.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ fn process_documentation_directory(docs_path: &Path) -> Result<Vec<Document>, Do
273273
if extension == Some("md") {
274274
// Process Markdown: Use raw content
275275
if !file_content.trim().is_empty() {
276+
eprintln!("[INFO] Including Markdown document: {}", path_str); // Moved log here
276277
documents.push(Document {
277278
path: path_str,
278279
content: file_content, // Store the raw Markdown content
@@ -284,12 +285,14 @@ fn process_documentation_directory(docs_path: &Path) -> Result<Vec<Document>, Do
284285
if let Some(main_content_element) = html_document.select(&content_selector).next() {
285286
let text_content: String = main_content_element
286287
.text()
288+
287289
.map(|s| s.trim())
288290
.filter(|s| !s.is_empty())
289291
.collect::<Vec<&str>>()
290292
.join("\n");
291293

292294
if !text_content.is_empty() {
295+
eprintln!("[INFO] Including Rust source document (raw): {}", path_str); // Moved log here
293296
documents.push(Document {
294297
path: path_str,
295298
content: text_content,
@@ -312,6 +315,7 @@ fn process_documentation_directory(docs_path: &Path) -> Result<Vec<Document>, Do
312315
.join("\n");
313316

314317
if !text_content.is_empty() {
318+
eprintln!("[INFO] Including HTML document (extracted): {}", path_str); // Moved log here
315319
documents.push(Document {
316320
path: path_str,
317321
content: text_content,

0 commit comments

Comments
 (0)