Improves logging for frontmatter processing
Enhances debugging output by including content length in log messages, assisting in monitoring and troubleshooting frontmatter parsing issues efficiently. Reduces redundant debug information, focusing on concise logging to maintain readability and effectiveness in error analysis.
This commit is contained in:
1 file changed
+2
-4
@@ -46,8 +46,7 @@ export class FrontmatterProcessor {
|
||||
// Use gray-matter for robust frontmatter parsing
|
||||
|
||||
// Add debugging to see what's being parsed
|
||||
console.debug('FrontmatterProcessor: Attempting to parse content with frontmatter pattern detected');
|
||||
console.debug('First 200 chars:', content.substring(0, 200));
|
||||
console.debug('FrontmatterProcessor: Attempting to parse content with frontmatter pattern detected', `(content length: ${content.length})`);
|
||||
|
||||
const parsed = matter(content);
|
||||
|
||||
@@ -150,8 +149,7 @@ export class FrontmatterProcessor {
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
console.error('FrontmatterProcessor: gray-matter failed with error:', errorMessage);
|
||||
console.error('Content being parsed (first 500 chars):', content.substring(0, 500));
|
||||
console.error('FrontmatterProcessor: gray-matter failed with error:', errorMessage, `(content length: ${content.length})`);
|
||||
result.warnings.push(`Failed to parse frontmatter with gray-matter: ${errorMessage}`);
|
||||
|
||||
// Fallback to simple regex-based parsing
|
||||
|
||||
Reference in new issue
Block a user